[前][次][番号順一覧][スレッド一覧]

ruby-changes:39199

From: nobu <ko1@a...>
Date: Fri, 17 Jul 2015 16:28:56 +0900 (JST)
Subject: [ruby-changes:39199] nobu:r51280 (trunk): RUBY_VM_CHECK_INTS_BLOCKING: move to thread.c

nobu	2015-07-17 16:28:36 +0900 (Fri, 17 Jul 2015)

  New Revision: 51280

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51280

  Log:
    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.

  Modified files:
    trunk/thread.c
    trunk/vm_core.h
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 51279)
+++ vm_core.h	(revision 51280)
@@ -1090,17 +1090,6 @@ void rb_threadptr_pending_interrupt_clea https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1090
 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); \
Index: thread.c
===================================================================
--- thread.c	(revision 51279)
+++ thread.c	(revision 51280)
@@ -164,6 +164,21 @@ static inline void blocking_region_end(r https://github.com/ruby/ruby/blob/trunk/thread.c#L164
     }; \
 } 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, ...);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]