X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Ftests%2Ftest_silcthread.c;h=da078b3e8af34b79a7bfa783b79e08720bb149ec;hb=e7b6c157b80152bf9fb9266e6bdd93f9fb0db776;hp=6305d7c100b2eede7934e1b81fe12d2cdfa54d87;hpb=b5a0146d1b6af614d718b8b99759fda9d3396861;p=silc.git diff --git a/lib/silcutil/tests/test_silcthread.c b/lib/silcutil/tests/test_silcthread.c index 6305d7c1..da078b3e 100644 --- a/lib/silcutil/tests/test_silcthread.c +++ b/lib/silcutil/tests/test_silcthread.c @@ -6,7 +6,8 @@ SilcSchedule schedule; static void func(SilcSchedule schedule, void *context) { - SILC_LOG_DEBUG(("func: %d", (int)context)); + silc_thread_tls_set(context); + SILC_LOG_DEBUG(("func: %d", (int)silc_thread_tls_get())); sleep(1); } @@ -27,7 +28,7 @@ int main(int argc, char **argv) silc_log_debug(TRUE); silc_log_quick(TRUE); silc_log_debug_hexdump(TRUE); - silc_log_set_debug_string("*thread*"); + silc_log_set_debug_string("*thread*,*errno*"); } schedule = silc_schedule_init(0, NULL, NULL); @@ -46,13 +47,13 @@ int main(int argc, char **argv) tp = silc_thread_pool_alloc(NULL, 0, 2, FALSE); if (!tp) goto err; - for (i = 0; i < 4; i++) { + for (i = 0; i < 6; i++) { SILC_LOG_DEBUG(("Run thread %d", i + 1)); if (!silc_thread_pool_run(tp, TRUE, NULL, func, (void *) i + 1, compl, (void *)i + 1)) goto err; } - sleep(4); + sleep(6); SILC_LOG_DEBUG(("Stop thread pool")); silc_thread_pool_free(tp, TRUE);