mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread_win32.c (ubf_handle): cancel blocking IO if it can (only
Vista). see [ruby-dev:35446] * win32/win32.c (errmap): add ERROR_OPERATION_ABORTED as EINTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
598fdcb730
commit
25498d24c8
3 changed files with 19 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
Tue Jul 15 18:12:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* thread_win32.c (ubf_handle): cancel blocking IO if it can (only
|
||||
Vista). see [ruby-dev:35446]
|
||||
|
||||
* win32/win32.c (errmap): add ERROR_OPERATION_ABORTED as EINTR.
|
||||
|
||||
Mon Jul 14 20:35:21 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||
|
||||
* test/win32ole/test_win32ole_event.rb (teardown): fix typo.
|
||||
|
|
|
@ -532,8 +532,19 @@ native_thread_apply_priority(rb_thread_t *th)
|
|||
static void
|
||||
ubf_handle(void *ptr)
|
||||
{
|
||||
static int checked = 0;
|
||||
typedef BOOL (WINAPI *cancel_io_func_t)(HANDLE);
|
||||
static cancel_io_func_t cancel_func = NULL;
|
||||
rb_thread_t *th = (rb_thread_t *)ptr;
|
||||
thread_debug("ubf_handle: %p\n", th);
|
||||
|
||||
if (!checked) {
|
||||
cancel_func = (cancel_io_func_t)GetProcAddress(GetModuleHandle("kernel32"), "CancelSynchronousIo");
|
||||
checked = 1;
|
||||
}
|
||||
if (cancel_func)
|
||||
cancel_func((HANDLE)th->thread_id);
|
||||
|
||||
w32_set_event(th->native_thread_data.interrupt_event);
|
||||
}
|
||||
|
||||
|
|
|
@ -164,6 +164,7 @@ static struct {
|
|||
{ ERROR_PIPE_BUSY, EAGAIN },
|
||||
{ ERROR_NO_DATA, EPIPE },
|
||||
{ ERROR_PIPE_NOT_CONNECTED, EPIPE },
|
||||
{ ERROR_OPERATION_ABORTED, EINTR },
|
||||
{ ERROR_NOT_ENOUGH_QUOTA, ENOMEM },
|
||||
{ WSAENAMETOOLONG, ENAMETOOLONG },
|
||||
{ WSAENOTEMPTY, ENOTEMPTY },
|
||||
|
|
Loading…
Reference in a new issue