[前][次][番号順一覧][スレッド一覧]

ruby-changes:46269

From: nobu <ko1@a...>
Date: Mon, 17 Apr 2017 22:23:48 +0900 (JST)
Subject: [ruby-changes:46269] nobu:r58382 (trunk): thread_win32.c: fix index

nobu	2017-04-17 22:23:42 +0900 (Mon, 17 Apr 2017)

  New Revision: 58382

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58382

  Log:
    thread_win32.c: fix index
    
    * thread_win32.c (w32_wait_events): fix wait object index in the
      case of interrupt_event is not usable.

  Modified files:
    trunk/thread_win32.c
Index: thread_win32.c
===================================================================
--- thread_win32.c	(revision 58381)
+++ thread_win32.c	(revision 58382)
@@ -163,6 +163,7 @@ w32_wait_events(HANDLE *events, int coun https://github.com/ruby/ruby/blob/trunk/thread_win32.c#L163
 {
     HANDLE *targets = events;
     HANDLE intr;
+    const int initcount = count;
     DWORD ret;
 
     thread_debug("  w32_wait_events events:%p, count:%d, timeout:%ld, th:%p\n",
@@ -184,7 +185,7 @@ w32_wait_events(HANDLE *events, int coun https://github.com/ruby/ruby/blob/trunk/thread_win32.c#L185
     ret = WaitForMultipleObjects(count, targets, FALSE, timeout);
     thread_debug("  WaitForMultipleObjects end (ret: %lu)\n", ret);
 
-    if (ret == (DWORD)(WAIT_OBJECT_0 + count - 1) && th) {
+    if (ret == (DWORD)(WAIT_OBJECT_0 + initcount) && th) {
 	errno = EINTR;
     }
     if (ret == WAIT_FAILED && THREAD_DEBUG) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]