summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-14 02:42:11 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-14 02:42:11 +0000
commitda06c63c66cd9901be498ab4a970332fbbeeceeb (patch)
tree024f8202ed51149e88508d354b37983889fdb0ad /thread.c
parent9895ce9f7706f1c941bee73ada4cb6ef2bd204b7 (diff)
* 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
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/thread.c b/thread.c
index 96ffd2a863..c22efd41b4 100644
--- a/thread.c
+++ b/thread.c
@@ -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);
}
}