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

ruby-changes:22050

From: nagachika <ko1@a...>
Date: Thu, 22 Dec 2011 22:46:12 +0900 (JST)
Subject: [ruby-changes:22050] nagachika:r34099 (trunk): * thread_pthread.c (ping_signal_thread_list): remove return value.

nagachika	2011-12-22 22:45:58 +0900 (Thu, 22 Dec 2011)

  New Revision: 34099

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

  Log:
    * thread_pthread.c (ping_signal_thread_list): remove return value.
    * thread_pthread.c (check_signal_thread_list): add a new function to
      check if signal thread list is empty.
    * thread_pthread.c (thread_timer): check signal thread list after
      timer_thread_function(). main thread might be added into signal thread
      list during timer_thread_function().

  Modified files:
    trunk/ChangeLog
    trunk/thread_pthread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34098)
+++ ChangeLog	(revision 34099)
@@ -1,3 +1,12 @@
+Thu Dec 22 22:37:45 2011  CHIKANAGA Tomoyuki  <nagachika00@g...>
+
+	* thread_pthread.c (ping_signal_thread_list): remove return value.
+	* thread_pthread.c (check_signal_thread_list): add a new function to
+	  check if signal thread list is empty.
+	* thread_pthread.c (thread_timer): check signal thread list after
+	  timer_thread_function(). main thread might be added into signal thread
+	  list during timer_thread_function().
+
 Thu Dec 22 00:40:24 2011  CHIKANAGA Tomoyuki  <nagachika00@g...>
 
 	* ext/bigdecimal/bigdecimal.c (VpMult, VpCtoV, VpSqrt): remove assigned
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 34098)
+++ thread_pthread.c	(revision 34099)
@@ -1024,7 +1024,7 @@
     ubf_select_each(th);
 }
 
-static int
+static void
 ping_signal_thread_list(void) {
     if (signal_thread_list_anchor.next) {
 	FGLOCK(&signal_thread_list_lock, {
@@ -1036,17 +1036,23 @@
 		list = list->next;
 	    }
 	});
+    }
+}
+
+static int
+check_signal_thread_list(void)
+{
+    if (signal_thread_list_anchor.next)
 	return 1;
-    }
-    else {
+    else
 	return 0;
-    }
 }
 #else /* USE_SIGNAL_THREAD_LIST */
 #define add_signal_thread_list(th) (void)(th)
 #define remove_signal_thread_list(th) (void)(th)
 #define ubf_select 0
-static int ping_signal_thread_list(void) { return 0; }
+static void ping_signal_thread_list(void) { return; }
+static int check_signal_thread_list(void) { return 0; }
 #endif /* USE_SIGNAL_THREAD_LIST */
 
 static int timer_thread_pipe[2] = {-1, -1};
@@ -1140,8 +1146,9 @@
 	int need_polling;
 
 	/* timer function */
-	need_polling = ping_signal_thread_list();
+	ping_signal_thread_list();
 	timer_thread_function(0);
+	need_polling = check_signal_thread_list();
 
 	if (TT_DEBUG) WRITE_CONST(2, "tick\n");
 

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

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