diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-10 07:16:42 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-10 07:16:42 +0000 |
commit | 00f60d074804e2d3a74c6108e40cd5910865f7fc (patch) | |
tree | 3c5668f5b5861d45a1599604fa1556a900322501 /thread_win32.ci | |
parent | f024801e1e1c5fe55bff16989026be0de6c91937 (diff) | |
download | ruby-00f60d074804e2d3a74c6108e40cd5910865f7fc.tar.gz |
* thread_win32.ci (w32_wait_events): check whether interrupt_event is
valid handle or not.
* thread_win32.ci (native_thread_destroy): clear interrupt_event when
close it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_win32.ci')
-rw-r--r-- | thread_win32.ci | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/thread_win32.ci b/thread_win32.ci index f04fb93968..d046775302 100644 --- a/thread_win32.ci +++ b/thread_win32.ci @@ -70,12 +70,12 @@ static int w32_wait_events(HANDLE *events, int count, DWORD timeout, rb_thread_t *th) { HANDLE *targets = events; + HANDLE intr; DWORD ret; thread_debug(" w32_wait_events events:%p, count:%d, timeout:%ld, th:%p\n", events, count, timeout, th); - if (th) { - HANDLE intr = th->native_thread_data.interrupt_event; + if (th && (intr = th->native_thread_data.interrupt_event)) { w32_reset_event(intr); if (th->interrupt_flag) { w32_set_event(intr); @@ -286,9 +286,10 @@ NOINLINE(static int static void native_thread_destroy(rb_thread_t *th) { - thread_debug("close handle - intr: %p, thid: %p\n", - th->native_thread_data.interrupt_event, th->thread_id); - w32_close_handle(th->native_thread_data.interrupt_event); + HANDLE intr = th->native_thread_data.interrupt_event; + thread_debug("close handle - intr: %p, thid: %p\n", intr, th->thread_id); + th->native_thread_data.interrupt_event = 0; + w32_close_handle(intr); } static unsigned int _stdcall |