+ if ((now = mono_100ns_ticks () / 10 / 1000 / 1000) == 0) {
+ g_warning ("failed to get 100ns ticks");
+ } else {
+ if (threadpool->worker_creation_current_second != now) {
+ threadpool->worker_creation_current_second = now;
+ threadpool->worker_creation_current_count = 0;
+ } else {
+ g_assert (threadpool->worker_creation_current_count <= WORKER_CREATION_MAX_PER_SEC);
+ if (threadpool->worker_creation_current_count == WORKER_CREATION_MAX_PER_SEC) {
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: maximum number of worker created per second reached, current count = %d",
+ mono_native_thread_id_get (), threadpool->worker_creation_current_count);
+ mono_coop_mutex_unlock (&threadpool->worker_creation_lock);
+ return FALSE;
+ }
+ }
+ }
+