X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fthreadpool.c;h=bef76e578159788083c0fbbc1fec9b2ea8b64258;hb=d4e61db1fefd1bbd82c8af3852a56c463644fb96;hp=07db889f26c197b15d71ab64d6992797c6381859;hpb=8cbeea47672e9d872345d869fc4ccd784ad5d8b7;p=mono.git diff --git a/mono/metadata/threadpool.c b/mono/metadata/threadpool.c index 07db889f26c..bef76e57815 100644 --- a/mono/metadata/threadpool.c +++ b/mono/metadata/threadpool.c @@ -801,18 +801,18 @@ ves_icall_System_Threading_ThreadPool_RequestWorkerThread (void) tpdomain->outstanding_request ++; g_assert (tpdomain->outstanding_request >= 1); - mono_refcount_inc (threadpool); + domains_unlock (); COUNTER_ATOMIC (threadpool, counter, { - if (!(counter._.starting < 32767 /* G_MAXINT16 */)) - g_error ("%s: counter._.starting = %d, but should be < 32767", __func__, counter._.starting); + if (counter._.starting == 16) + return TRUE; counter._.starting ++; }); - mono_threadpool_worker_enqueue (threadpool->worker, worker_callback, NULL); + mono_refcount_inc (threadpool); - domains_unlock (); + mono_threadpool_worker_enqueue (threadpool->worker, worker_callback, NULL); return TRUE; }