mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
thread_win32.c: fix index
* thread_win32.c (w32_wait_events): fix wait object index in the case of interrupt_event is not usable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
61ea519dc0
commit
97819765a6
1 changed files with 2 additions and 1 deletions
|
@ -163,6 +163,7 @@ w32_wait_events(HANDLE *events, int count, DWORD timeout, rb_thread_t *th)
|
|||
{
|
||||
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 count, DWORD timeout, rb_thread_t *th)
|
|||
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) {
|
||||
|
|
Loading…
Reference in a new issue