summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authortarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-04 18:38:21 +0000
committertarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-04 18:38:21 +0000
commit64f634f1de8581e398843b2f178827dbcaa90a30 (patch)
tree0a2348d835af9d09b1a1b8984c02ed868c342e8c /vm_core.h
parent28ee4c296680e9131c6d7869d0fd523738af2b89 (diff)
* vm_core.h (RUBY_VM_CHECK_INTS_BLOCKING): check async queue everytime.
* thread.c (sleep_forever): check RUBY_VM_CHECK_INTS_BLOCKING first. * thread.c (sleep_timeval): ditto. * test/ruby/test_thread.rb (test_async_interrupt_blocking): add a test exceptions are correctly defared and raised on :on_blocking context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/vm_core.h b/vm_core.h
index 900c7581bf..2a22ffeff5 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -889,11 +889,16 @@ int rb_threadptr_async_errinfo_active_p(rb_thread_t *th);
void rb_thread_lock_unlock(rb_thread_lock_t *);
void rb_thread_lock_destroy(rb_thread_lock_t *);
-#define RUBY_VM_CHECK_INTS_BLOCKING(th) do { \
- if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) { \
- rb_threadptr_execute_interrupts(th, 1); \
- } \
-} while (0)
+#define RUBY_VM_CHECK_INTS_BLOCKING(th) do { \
+ if (UNLIKELY(!rb_threadptr_async_errinfo_empty_p(th))) { \
+ th->async_errinfo_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))) { \