diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-30 18:30:36 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-30 18:30:36 +0000 |
commit | 3e52864df7781d474523fe6eed93a404e42fc558 (patch) | |
tree | e4855d9f2e2b103eb07ae99fb84e78e005fb6275 | |
parent | 4e08026c7024f66543ce08f1f3960ad4db09566a (diff) | |
download | ruby-3e52864df7781d474523fe6eed93a404e42fc558.tar.gz ruby-3e52864df7781d474523fe6eed93a404e42fc558.tar.xz ruby-3e52864df7781d474523fe6eed93a404e42fc558.zip |
* thread_win32.c (native_thread_destroy): decreased the probability of
using the interrupt event in the thread termination.
see [ruby-core:27199].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | thread_win32.c | 3 |
2 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Thu Dec 31 03:27:53 2009 NAKAMURA Usaku <usa@ruby-lang.org> + + * thread_win32.c (native_thread_destroy): decreased the probability of + using the interrupt event in the thread termination. + see [ruby-core:27199]. + Thu Dec 31 02:35:57 2009 NAKAMURA Usaku <usa@ruby-lang.org> * thread_win32.c (w32_error): should report the function. diff --git a/thread_win32.c b/thread_win32.c index 1a7917e51..3cff714e8 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -449,10 +449,9 @@ native_thread_init_stack(rb_thread_t *th) static void native_thread_destroy(rb_thread_t *th) { - HANDLE intr = th->native_thread_data.interrupt_event; + HANDLE intr = InterlockedExchangePointer(&th->native_thread_data.interrupt_event, 0); native_mutex_destroy(&th->interrupt_lock); thread_debug("close handle - intr: %p, thid: %p\n", intr, th->thread_id); - th->native_thread_data.interrupt_event = 0; w32_close_handle(intr); } |