Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* 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
  • Loading branch information...
commit 00f60d074804e2d3a74c6108e40cd5910865f7fc 1 parent f024801
@unak unak authored
Showing with 14 additions and 5 deletions.
  1. +8 −0 ChangeLog
  2. +6 −5 thread_win32.ci
View
8 ChangeLog
@@ -1,3 +1,11 @@
+Tue Apr 10 16:14:22 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * 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.
+
Tue Apr 10 15:53:17 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* thread_pthread.ci (native_thread_create): initialize sleep_cond.
View
11 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
Please sign in to comment.
Something went wrong with that request. Please try again.