[runtime] Fix build
authorLudovic Henry <ludovic@xamarin.com>
Sat, 3 Dec 2016 23:42:04 +0000 (18:42 -0500)
committerLudovic Henry <ludovic@xamarin.com>
Sat, 3 Dec 2016 23:42:04 +0000 (18:42 -0500)
mono/metadata/threads.c

index 43bbeab13e4cb238f4d8fac5f57059cf5471ec23..47b4b691690317bae645137e9b1fcaa1b6ac544e 100644 (file)
@@ -1615,6 +1615,47 @@ mono_thread_internal_current (void)
        return res;
 }
 
+static MonoThreadInfoWaitRet
+mono_join_uninterrupted (MonoThreadHandle* thread_to_join, gint32 ms, MonoError *error)
+{
+       MonoException *exc;
+       MonoThreadInfoWaitRet ret;
+       gint64 start;
+       gint32 diff_ms;
+       gint32 wait = ms;
+
+       mono_error_init (error);
+
+       start = (ms == -1) ? 0 : mono_msec_ticks ();
+       for (;;) {
+               MONO_ENTER_GC_SAFE;
+               ret = mono_thread_info_wait_one_handle (thread_to_join, ms, TRUE);
+               MONO_EXIT_GC_SAFE;
+
+               if (ret != MONO_THREAD_INFO_WAIT_RET_ALERTED)
+                       return ret;
+
+               exc = mono_thread_execute_interruption ();
+               if (exc) {
+                       mono_error_set_exception_instance (error, exc);
+                       return ret;
+               }
+
+               if (ms == -1)
+                       continue;
+
+               /* Re-calculate ms according to the time passed */
+               diff_ms = (gint32)(mono_msec_ticks () - start);
+               if (diff_ms >= ms) {
+                       ret = MONO_THREAD_INFO_WAIT_RET_TIMEOUT;
+                       return ret;
+               }
+               wait = ms - diff_ms;
+       }
+
+       return ret;
+}
+
 gboolean
 ves_icall_System_Threading_Thread_Join_internal(MonoThread *this_obj, int ms)
 {
@@ -1734,47 +1775,6 @@ mono_wait_uninterrupted (MonoInternalThread *thread, guint32 numhandles, gpointe
        return ret;
 }
 
-static MonoThreadInfoWaitRet
-mono_join_uninterrupted (MonoThreadHandle* thread_to_join, gint32 ms, MonoError *error)
-{
-       MonoException *exc;
-       MonoThreadInfoWaitRet ret;
-       gint64 start;
-       gint32 diff_ms;
-       gint32 wait = ms;
-
-       mono_error_init (error);
-
-       start = (ms == -1) ? 0 : mono_msec_ticks ();
-       for (;;) {
-               MONO_ENTER_GC_SAFE;
-               ret = mono_thread_info_wait_one_handle (thread_to_join, ms, TRUE);
-               MONO_EXIT_GC_SAFE;
-
-               if (ret != MONO_THREAD_INFO_WAIT_RET_ALERTED)
-                       return ret;
-
-               exc = mono_thread_execute_interruption ();
-               if (exc) {
-                       mono_error_set_exception_instance (error, exc);
-                       return ret;
-               }
-
-               if (ms == -1)
-                       continue;
-
-               /* Re-calculate ms according to the time passed */
-               diff_ms = (gint32)(mono_msec_ticks () - start);
-               if (diff_ms >= ms) {
-                       ret = MONO_THREAD_INFO_WAIT_RET_TIMEOUT;
-                       return ret;
-               }
-               wait = ms - diff_ms;
-       }
-
-       return ret;
-}
-
 gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms)
 {
        MonoError error;