Merge pull request #3028 from lateralusX/jlorenss/threadpool_warning
authorLudovic Henry <ludovic@xamarin.com>
Thu, 26 May 2016 13:26:51 +0000 (15:26 +0200)
committerLudovic Henry <ludovic@xamarin.com>
Thu, 26 May 2016 13:26:51 +0000 (15:26 +0200)
Incorrect warning message on thread pool startup in full AOT:ed Windows build.

mono/metadata/threadpool-ms.c

index 9e18e8c3eff9a66a2d5a06c22805a3a17e8d56ea..1f4a6cc605237a36e6f13c3a28acc3c229086dff 100644 (file)
@@ -708,13 +708,15 @@ worker_try_create (void)
 {
        ThreadPoolCounter counter;
        MonoInternalThread *thread;
+       gint64 current_ticks;
        gint32 now;
 
        mono_coop_mutex_lock (&threadpool->worker_creation_lock);
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker", mono_native_thread_id_get ());
-
-       if ((now = mono_100ns_ticks () / 10 / 1000 / 1000) == 0) {
+       current_ticks = mono_100ns_ticks ();
+       now = current_ticks / (10 * 1000 * 1000);
+       if (0 == current_ticks) {
                g_warning ("failed to get 100ns ticks");
        } else {
                if (threadpool->worker_creation_current_second != now) {