[runtime] Avoid busy waiting when using the MONO_DEBUG=suspend-on-sigsegv option.
authorZoltan Varga <vargaz@gmail.com>
Wed, 27 Nov 2013 09:11:27 +0000 (10:11 +0100)
committerZoltan Varga <vargaz@gmail.com>
Wed, 27 Nov 2013 09:11:27 +0000 (10:11 +0100)
mono/mini/mini-exceptions.c

index 5aff40769534f78586792b24332b5d4543c3bd3e..e8e2d5b682ae7c17830c158ced1d293c7683b507 100644 (file)
@@ -2233,8 +2233,9 @@ mono_handle_native_sigsegv (int signal, void *ctx)
 
        if (mini_get_debug_options ()->suspend_on_sigsegv) {
                mono_runtime_printf_err ("Received SIGSEGV, suspending...");
-               while (1)
-                       ;
+               while (1) {
+                       sleep (0);
+               }
        }
 
        /* To prevent infinite loops when the stack walk causes a crash */