diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-17 07:28:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-17 07:28:36 +0000 |
commit | a9dcd5a5ebe3f33695fd6dcc378116a4bd7ccba8 (patch) | |
tree | c89e15a324d662e5ffc7d08dea39a9b6d014ef6b /thread.c | |
parent | 3792e211fb6e0679a5a557e17284d6b6dbe98f7b (diff) | |
download | ruby-a9dcd5a5ebe3f33695fd6dcc378116a4bd7ccba8.tar.gz |
RUBY_VM_CHECK_INTS_BLOCKING: move to thread.c
* thread.c (RUBY_VM_CHECK_INTS_BLOCKING): move from vm_core.h for
the static function rb_threadptr_pending_interrupt_empty_p.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -164,6 +164,21 @@ static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_regio }; \ } while(0) +#define RUBY_VM_CHECK_INTS_BLOCKING(th) vm_check_ints_blocking(th) +static inline void +vm_check_ints_blocking(rb_thread_t *th) +{ + if (UNLIKELY(!rb_threadptr_pending_interrupt_empty_p(th))) { + th->pending_interrupt_queue_checked = 0; + + RUBY_VM_SET_INTERRUPT(th); + rb_threadptr_execute_interrupts(th, 1); + } + else if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) { + rb_threadptr_execute_interrupts(th, 1); + } +} + #if THREAD_DEBUG #ifdef HAVE_VA_ARGS_MACRO void rb_thread_debug(const char *file, int line, const char *fmt, ...); |