diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-20 10:47:53 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-20 10:47:53 +0000 |
commit | 3453b2bd0e186788bb81deff5d723cf48e10881f (patch) | |
tree | 329d42bdbd0d45463caf6b6f3c67c9443f9153be /thread_win32.ci | |
parent | d481323b9211cc0823fba407253d0432fa7f1734 (diff) |
* gc.h, vm_core.h: decl of rb_gc_save_machine_context()
should be at vm_core.h.
* include/ruby/ruby.h, intern.h: remove type rb_thread_t.
* include/ruby/intern.h: change rb_unblock_function_t,
rb_unblock_function_t.
* file.c, process.c: apply above changes.
* thread.c, thread_pthread.ci, thread_win32.ci: ditto.
* io.c: support blocking open (2). [ruby-core:13614]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_win32.ci')
-rw-r--r-- | thread_win32.ci | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/thread_win32.ci b/thread_win32.ci index c2a4a286a7..d71040836b 100644 --- a/thread_win32.ci +++ b/thread_win32.ci @@ -122,7 +122,7 @@ w32_wait_events(HANDLE *events, int count, DWORD timeout, rb_thread_t *th) return ret; } -static void ubf_handle(rb_thread_t *th, void *ptr); +static void ubf_handle(void *ptr); #define ubf_select ubf_handle int @@ -136,7 +136,8 @@ rb_w32_wait_events(HANDLE *events, int num, DWORD timeout) { int ret; - BLOCKING_REGION(ret = rb_w32_wait_events_blocking(events, num, timeout), ubf_handle, 0); + BLOCKING_REGION(ret = rb_w32_wait_events_blocking(events, num, timeout), + ubf_handle, GET_THREAD()); return ret; } @@ -187,7 +188,8 @@ rb_w32_Sleep(unsigned long msec) { int ret; - BLOCKING_REGION(ret = rb_w32_sleep(msec), ubf_handle, 0); + BLOCKING_REGION(ret = rb_w32_sleep(msec), + ubf_handle, GET_THREAD()); return ret; } @@ -208,10 +210,12 @@ native_sleep(rb_thread_t *th, struct timeval *tv) int status = th->status; th->status = THREAD_STOPPED; th->unblock_function = ubf_handle; + th->unblock_function_arg = th; thread_debug("native_sleep start (%d)\n", (int)msec); ret = w32_wait_events(0, 0, msec, th); thread_debug("native_sleep done (%d)\n", ret); th->unblock_function = 0; + th->unblock_function_arg = 0; th->status = status; } GVL_UNLOCK_END(); @@ -465,8 +469,9 @@ native_thread_apply_priority(rb_thread_t *th) } static void -ubf_handle(rb_thread_t *th, void *ptr) +ubf_handle(void *ptr) { + rb_thread_t *th = (rb_thread_t *)ptr; thread_debug("ubf_handle: %p\n", th); w32_set_event(th->native_thread_data.interrupt_event); } |