Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Aug 2010 20:49:06 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r211896 - head/sbin/hastd
Message-ID:  <201008272049.o7RKn63o007138@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Fri Aug 27 20:49:06 2010
New Revision: 211896
URL: http://svn.freebsd.org/changeset/base/211896

Log:
  Check if no signals were delivered just before going to sleep.
  
  MFC after:	2 weeks
  Obtained from:	Wheel Systems Sp. z o.o. http://www.wheelsystems.com

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c	Fri Aug 27 20:48:12 2010	(r211895)
+++ head/sbin/hastd/primary.c	Fri Aug 27 20:49:06 2010	(r211896)
@@ -1988,7 +1988,9 @@ guard_thread(void *arg)
 				rw_unlock(&hio_remote_lock[ii]);
 			}
 		}
-		(void)cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout);
+		/* Sleep only if a signal wasn't delivered in the meantime. */
+		if (!sigexit_received && !sighup_received && !sigchld_received)
+			cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout);
 		mtx_unlock(&hio_guard_lock);
 	}
 	/* NOTREACHED */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008272049.o7RKn63o007138>