2005-01-17 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Mon, 17 Jan 2005 13:19:02 +0000 (13:19 -0000)
committerZoltan Varga <vargaz@gmail.com>
Mon, 17 Jan 2005 13:19:02 +0000 (13:19 -0000)
* threads.c (signal_thread_state_change): Handle the case when the
target thread is the current thread.

svn path=/trunk/mono/; revision=39018

mono/metadata/ChangeLog
mono/metadata/threads.c

index 54896fd2ebcfa99f510bc3445618e8807375633e..35acd3d287aeb63d01f86d5b4497f2e1409c31ac 100644 (file)
@@ -1,5 +1,8 @@
 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
 
+       * threads.c (signal_thread_state_change): Handle the case when the
+       target thread is the current thread.
+
        * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
 
        * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
index 2082b4d77f4df48d10b498dda44de182c589cacd..f7173b975c32057dacceaa0d456e09be1ee3fbe1 100644 (file)
@@ -1274,6 +1274,13 @@ static CALLBACK void interruption_request_apc (ULONG_PTR param)
  */
 static void signal_thread_state_change (MonoThread *thread)
 {
+       if (thread == mono_thread_current ()) {
+               /* Do it synchronously */
+               MonoException *exc = mono_thread_request_interruption (FALSE); 
+               if (exc)
+                       mono_raise_exception (exc);
+       }
+
 #ifdef __MINGW32__
        QueueUserAPC (interruption_request_apc, thread->handle, NULL);
 #else