mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
01962439e9
commit
ce7fdcf0f8
2 changed files with 15 additions and 11 deletions
15
thread.c
15
thread.c
|
@ -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, ...);
|
||||
|
|
11
vm_core.h
11
vm_core.h
|
@ -1090,17 +1090,6 @@ void rb_threadptr_pending_interrupt_clear(rb_thread_t *th);
|
|||
void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v);
|
||||
int rb_threadptr_pending_interrupt_active_p(rb_thread_t *th);
|
||||
|
||||
#define RUBY_VM_CHECK_INTS_BLOCKING(th) do { \
|
||||
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); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define RUBY_VM_CHECK_INTS(th) do { \
|
||||
if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) { \
|
||||
rb_threadptr_execute_interrupts(th, 0); \
|
||||
|
|
Loading…
Reference in a new issue