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

* thread.c (set_unblock_function): fix function interface.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2007-02-14 02:42:11 +00:00
parent 9895ce9f77
commit da06c63c66
2 changed files with 9 additions and 10 deletions

View file

@ -1,3 +1,7 @@
Wed Feb 14 11:39:18 2007 Koichi Sasada <ko1@atdot.net>
* thread.c (set_unblock_function): fix function interface.
Wed Feb 14 11:12:02 2007 Koichi Sasada <ko1@atdot.net>
* eval_load.c, yarvcore.h: use rb_vm_t#loaded_features instead of

View file

@ -76,7 +76,7 @@ st_delete_wrap(st_table * table, VALUE key)
#define THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
static void set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, int is_return);
static void set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func);
static void clear_unblock_function(rb_thread_t *th);
NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
@ -95,7 +95,7 @@ NOINLINE(void rb_gc_save_machine_context(rb_thread_t *));
#define BLOCKING_REGION(exec, ubf) do { \
rb_thread_t *__th = GET_THREAD(); \
int __prev_status = __th->status; \
set_unblock_function(__th, ubf, 0); \
set_unblock_function(__th, ubf); \
__th->status = THREAD_STOPPED; \
GVL_UNLOCK_BEGIN(); {\
exec; \
@ -160,20 +160,15 @@ thread_debug(const char *fmt, ...)
static void
set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, int is_return)
set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func)
{
check_ints:
RUBY_VM_CHECK_INTS();
RUBY_VM_CHECK_INTS(); /* check signal or so */
native_mutex_lock(&th->interrupt_lock);
if (th->interrupt_flag) {
native_mutex_unlock(&th->interrupt_lock);
if (is_return) {
return;
}
else {
goto check_ints;
}
}
else {
th->unblock_function = func;
}
@ -193,7 +188,6 @@ rb_thread_interrupt(rb_thread_t *th)
{
native_mutex_lock(&th->interrupt_lock);
th->interrupt_flag = 1;
if (th->unblock_function) {
(th->unblock_function)(th);
}
@ -398,6 +392,7 @@ thread_join(rb_thread_t *target_th, double delay)
GET_THROWOBJ_STATE(err), GET_THROWOBJ_VAL(err)));
}
else {
/* normal exception */
rb_exc_raise(err);
}
}