public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* rgmanager: master - rgmanager: Remove sleep in startup of event thread
@ 2009-03-12 15:12 Lon Hohberger
  0 siblings, 0 replies; only message in thread
From: Lon Hohberger @ 2009-03-12 15:12 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/rgmanager.git?p=rgmanager.git;a=commitdiff;h=15e48b31f2d7e3108f9b899a501a3015821e1e2c
Commit:        15e48b31f2d7e3108f9b899a501a3015821e1e2c
Parent:        1c5c0658b56fd266f46e025d2d6298a6bec7d804
Author:        Lon Hohberger <lhh@redhat.com>
AuthorDate:    Thu Mar 5 16:23:33 2009 -0500
Committer:     Lon Hohberger <lhh@redhat.com>
CommitterDate: Thu Mar 12 11:10:58 2009 -0400

rgmanager: Remove sleep in startup of event thread

There's no reason to sleep here, and it delays processing
of potentially important events.

Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
 rgmanager/src/daemons/rg_event.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/rgmanager/src/daemons/rg_event.c b/rgmanager/src/daemons/rg_event.c
index cb36db6..a1a07c6 100644
--- a/rgmanager/src/daemons/rg_event.c
+++ b/rgmanager/src/daemons/rg_event.c
@@ -46,8 +46,8 @@ event_table_t *master_event_table = NULL;
 void
 set_transition_throttling(int nsecs)
 {
-	if (nsecs < 0)
-		nsecs = 0;
+	if (nsecs < 1)
+		nsecs = 1;
 	transition_throttling = nsecs;
 }
 
@@ -378,19 +378,12 @@ _event_thread_f(void __attribute__ ((unused)) *arg)
 	struct timespec expire;
 	int notice = 0, count = 0;
 
-	/* Event thread usually doesn't hang around.  When it's
-   	   spawned, sleep for this many seconds in order to let
-   	   some events queue up */
-	if (transition_throttling && !central_events) {
-		sleep(transition_throttling);
-	}
-
 	while (1) {
 		pthread_mutex_lock(&event_queue_mutex);
 		ev = event_queue;
 		if (!ev && !central_events) {
 			gettimeofday(&now, NULL);
-			expire.tv_sec = now.tv_sec + 5;
+			expire.tv_sec = now.tv_sec + transition_throttling;
 			expire.tv_nsec = now.tv_usec * 1000;
 			pthread_cond_timedwait(&event_queue_cond,
 						&event_queue_mutex,


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-12 15:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12 15:12 rgmanager: master - rgmanager: Remove sleep in startup of event thread Lon Hohberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).