[threads] Fix suspend on watchos
authorLudovic Henry <ludovic@xamarin.com>
Fri, 28 Oct 2016 13:10:23 +0000 (09:10 -0400)
committerLudovic Henry <ludovic@xamarin.com>
Fri, 28 Oct 2016 13:12:26 +0000 (09:12 -0400)
Because certain platform (such as WatchOS) do not support syscall abort, we need to ensure that it is supported before we call the `mono_threads_suspend_abort_syscall` function.

mono/utils/mono-threads.c

index 49031c860e505d51a23f97b3fe86ee4f3cb1f160..ce4750b183a3da6588ddd474c2e1bfaa5d3f7a81 100644 (file)
@@ -912,7 +912,7 @@ suspend_sync (MonoNativeThreadId tid, gboolean interrupt_kernel)
                }
                break;
        case AsyncSuspendBlocking:
-               if (interrupt_kernel)
+               if (interrupt_kernel && mono_threads_suspend_needs_abort_syscall ())
                        mono_threads_suspend_abort_syscall (info);
 
                break;