1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* win32/win32.c (overlapped_socket_io): avoid warnings.

* thread_win32.c (ubf_handle): refactoring.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2008-07-24 07:05:49 +00:00
parent f8f7f884c1
commit f92478c0fb
3 changed files with 26 additions and 15 deletions

View file

@ -519,17 +519,17 @@ 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) {
if (!cancel_func) {
cancel_func = (cancel_io_func_t)GetProcAddress(GetModuleHandle("kernel32"), "CancelSynchronousIo");
checked = 1;
if (!cancel_func)
cancel_func = (cancel_io_func_t)-1;
}
if (cancel_func)
if (cancel_func != (cancel_io_func_t)-1)
cancel_func((HANDLE)th->thread_id);
w32_set_event(th->native_thread_data.interrupt_event);