public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Lon Hohberger <lon@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: RHEL53 - rgmanager: Remove sleep in startup of event thread
Date: Mon, 23 Mar 2009 14:50:00 -0000	[thread overview]
Message-ID: <20090323144959.0B96D12015A@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=309670a1a55875cee4d24a31a6dc8d5a5ce2d5d4
Commit:        309670a1a55875cee4d24a31a6dc8d5a5ce2d5d4
Parent:        3f987399dbe8fcb2fd9727094ffd7d861cc0f67c
Author:        Lon Hohberger <lhh@redhat.com>
AuthorDate:    Thu Mar 5 16:23:33 2009 -0500
Committer:     Lon Hohberger <lhh@redhat.com>
CommitterDate: Thu Mar 5 16:23:33 2009 -0500

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 d2c7cd3..c63f26c 100644
--- a/rgmanager/src/daemons/rg_event.c
+++ b/rgmanager/src/daemons/rg_event.c
@@ -64,8 +64,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;
 }
 
@@ -396,19 +396,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,


                 reply	other threads:[~2009-03-23 14:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090323144959.0B96D12015A@lists.fedorahosted.org \
    --to=lon@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).