X-Git-Url: http://git.silcnet.org/gitweb/?p=crypto.git;a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcthread.c;h=8e51a15d13ef4c182382cf029f3b0f41512c3deb;hp=3ada012c14e86c3c264c0f275a0476fbd1f2d523;hb=51558729d89b9f3492b2ca754242ed548a579ca4;hpb=1c3ae0efc13419718213114e140c3d83b4608c1e diff --git a/lib/silcutil/silcthread.c b/lib/silcutil/silcthread.c index 3ada012c..8e51a15d 100644 --- a/lib/silcutil/silcthread.c +++ b/lib/silcutil/silcthread.c @@ -319,10 +319,16 @@ SilcThreadPool silc_thread_pool_alloc(SilcStack stack, SilcThreadPool tp; int i; - if (max_threads < min_threads) + if (max_threads < min_threads) { + silc_set_errno_reason(SILC_ERR_INVALID_ARGUMENT, + "Max threads is smaller than min threads (%d < %d)", + max_threads, min_threads); return NULL; - if (!max_threads) + } + if (!max_threads) { + silc_set_errno_reason(SILC_ERR_INVALID_ARGUMENT, "Max threads is 0"); return NULL; + } if (stack) stack = silc_stack_alloc(0, stack); @@ -411,6 +417,7 @@ SilcBool silc_thread_pool_run(SilcThreadPool tp, if (tp->destroy) { silc_mutex_unlock(tp->lock); + silc_set_errno(SILC_ERR_NOT_VALID); return FALSE; } @@ -422,6 +429,7 @@ SilcBool silc_thread_pool_run(SilcThreadPool tp, /* Maximum threads reached */ if (!queuable) { silc_mutex_unlock(tp->lock); + silc_set_errno(SILC_ERR_LIMIT); return FALSE; }