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

ruby-changes:25674

From: kosaki <ko1@a...>
Date: Mon, 19 Nov 2012 20:13:49 +0900 (JST)
Subject: [ruby-changes:25674] kosaki:r37731 (trunk): * thread.c (rb_threadptr_async_errinfo_active_p): added a small

kosaki	2012-11-19 20:13:40 +0900 (Mon, 19 Nov 2012)

  New Revision: 37731

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

  Log:
    * thread.c (rb_threadptr_async_errinfo_active_p): added a small
      comment.

  Modified files:
    trunk/ChangeLog
    trunk/thread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37730)
+++ ChangeLog	(revision 37731)
@@ -1,3 +1,8 @@
+Tue Nov 20 10:12:46 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* thread.c (rb_threadptr_async_errinfo_active_p): added a small
+	  comment.
+
 Tue Nov 20 10:08:45 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* thread.c, vm_core.h: big rename th to cur_th when works only
Index: thread.c
===================================================================
--- thread.c	(revision 37730)
+++ thread.c	(revision 37731)
@@ -1476,12 +1476,20 @@
 int
 rb_threadptr_async_errinfo_active_p(rb_thread_t *th)
 {
-    if (th->async_errinfo_queue_checked || rb_threadptr_async_errinfo_empty_p(th)) {
+    /*
+     * For optimization, we don't check async errinfo queue
+     * if it nor a thread interrupt mask were not changed
+     * since last check.
+     */
+    if (th->async_errinfo_queue_checked) {
 	return 0;
     }
-    else {
-	return 1;
+
+    if (rb_threadptr_async_errinfo_empty_p(th)) {
+	return 0;
     }
+
+    return 1;
 }
 
 static VALUE

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

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