From 9f90682c4b60bf9788b94ccb107ac6b8a5cc5f7e Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 30 Dec 2009 18:30:36 +0000 Subject: * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@26207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_win32.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'thread_win32.c') diff --git a/thread_win32.c b/thread_win32.c index 1a7917e..3cff714 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); } -- cgit v1.1