aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-18 12:29:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-18 12:29:21 +0000
commit22f75c300d1fc5341fb21126adc787f30c310bdf (patch)
tree800452d6904ff4c3b559970524b9893aa0d479c6 /thread.c
parent1998039ea4f867583d7e37ce200a88490707c330 (diff)
downloadruby-22f75c300d1fc5341fb21126adc787f30c310bdf.tar.gz
thread.c: gather common statements
* thread.c (vm_check_ints_blocking): gather common statements at the end, and prefer LIKELY for Visual C optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/thread.c b/thread.c
index 728a0db084..7bef5eb919 100644
--- a/thread.c
+++ b/thread.c
@@ -168,15 +168,15 @@ static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_regio
static inline void
vm_check_ints_blocking(rb_thread_t *th)
{
- if (UNLIKELY(!rb_threadptr_pending_interrupt_empty_p(th))) {
+ if (LIKELY(rb_threadptr_pending_interrupt_empty_p(th))) {
+ if (LIKELY(!RUBY_VM_INTERRUPTED_ANY(th))) return;
+ }
+ else {
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);
}
+ rb_threadptr_execute_interrupts(th, 1);
}
#if THREAD_DEBUG