[tests] Fix thread-native-exit test on windows
authorLudovic Henry <ludovic@xamarin.com>
Mon, 3 Oct 2016 17:19:25 +0000 (19:19 +0200)
committerLudovic Henry <ludovic@xamarin.com>
Mon, 3 Oct 2016 20:25:51 +0000 (22:25 +0200)
mono/tests/thread-native-exit.cs

index 16af9f66a7a56143f92ae0e5edaef17a50b4a803..e112be0fa16e46960bfafae3f5572c7bbd08bfb0 100644 (file)
@@ -15,15 +15,10 @@ class Driver
        {
                return new Thread (() => {
                        /* Exit bypassing completely the runtime */
-                       try {
-                               pthread_exit (IntPtr.Zero);
-                       } catch (EntryPointNotFoundException) {
-                       }
-
-                       try {
-                               ExitThread (IntPtr.Zero);
-                       } catch (EntryPointNotFoundException) {
-                       }
+                       if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
+                           pthread_exit (IntPtr.Zero);
+                       else
+                           ExitThread (IntPtr.Zero);
                });
        }