Date: Thu, 7 Oct 2010 18:19:02 +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: r213530 - head/sbin/hastd Message-ID: <201010071819.o97IJ2OX049723@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Thu Oct 7 18:19:02 2010 New Revision: 213530 URL: http://svn.freebsd.org/changeset/base/213530 Log: Start the guard thread first, so we can handle signals from the very begining. Reported by: Mikolaj Golub <to.my.trociny@gmail.com> MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Oct 7 18:16:22 2010 (r213529) +++ head/sbin/hastd/primary.c Thu Oct 7 18:19:02 2010 (r213530) @@ -791,6 +791,12 @@ hastd_primary(struct hast_resource *res) init_ggate(res); init_environment(res); /* + * Create the guard thread first, so we can handle signals from the + * very begining. + */ + error = pthread_create(&td, NULL, guard_thread, res); + assert(error == 0); + /* * Create the control thread before sending any event to the parent, * as we can deadlock when parent sends control request to worker, * but worker has no control thread started yet, so parent waits. @@ -812,9 +818,7 @@ hastd_primary(struct hast_resource *res) assert(error == 0); error = pthread_create(&td, NULL, ggate_send_thread, res); assert(error == 0); - error = pthread_create(&td, NULL, sync_thread, res); - assert(error == 0); - (void)guard_thread(res); + (void)sync_thread(res); } static void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010071819.o97IJ2OX049723>