mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm_core.h (struct rb_unblock_callback), thread.c
(set_unblock_function), thread_{pthread,win32}.c (native_sleep):
extracted from struct rb_thread_struct.
* thread.c (reset_unblock_function): not check interrupts at leaving
blocking region. [ruby-dev:34874]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b9ff5a2fd6
commit
1b63d7bc92
4 changed files with 34 additions and 23 deletions
|
|
@ -424,8 +424,8 @@ native_sleep(rb_thread_t *th, struct timeval *tv)
|
|||
GVL_UNLOCK_BEGIN();
|
||||
{
|
||||
pthread_mutex_lock(&th->interrupt_lock);
|
||||
th->unblock_function = ubf_pthread_cond_signal;
|
||||
th->unblock_function_arg = th;
|
||||
th->unblock.func = ubf_pthread_cond_signal;
|
||||
th->unblock.arg = th;
|
||||
|
||||
if (RUBY_VM_INTERRUPTED(th)) {
|
||||
/* interrupted. return immediate */
|
||||
|
|
@ -451,8 +451,8 @@ native_sleep(rb_thread_t *th, struct timeval *tv)
|
|||
thread_debug("native_sleep: pthread_cond_timedwait end (%d)\n", r);
|
||||
}
|
||||
}
|
||||
th->unblock_function = 0;
|
||||
th->unblock_function_arg = 0;
|
||||
th->unblock.func = 0;
|
||||
th->unblock.arg = 0;
|
||||
|
||||
pthread_mutex_unlock(&th->interrupt_lock);
|
||||
th->status = prev_status;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue