[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xenstore: block signals in watch wakeup thread


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Fri, 08 Jun 2012 00:44:07 +0000
  • Delivery-date: Fri, 08 Jun 2012 00:44:17 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Simon Rowe <simon.rowe@xxxxxxxxxxxxx>
# Date 1339089740 -3600
# Node ID 32a31e2cb03942f95a9453bba172e8732101761e
# Parent  f6bfaf9daa508c31b2bca0e461202db2759426fc
xenstore: block signals in watch wakeup thread

The thread created to wakeup watchers is not intended to handle signals
(and a later patch will reduce it's stack size which makes it unsuitable
for doing so).

Signed-off-by: Simon Rowe <simon.rowe@xxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r f6bfaf9daa50 -r 32a31e2cb039 tools/xenstore/xs.c
--- a/tools/xenstore/xs.c       Wed Jun 06 16:37:05 2012 +0100
+++ b/tools/xenstore/xs.c       Thu Jun 07 18:22:20 2012 +0100
@@ -705,11 +705,18 @@ bool xs_watch(struct xs_handle *h, const
        /* We dynamically create a reader thread on demand. */
        mutex_lock(&h->request_mutex);
        if (!h->read_thr_exists) {
+               sigset_t set, old_set;
+
+               sigfillset(&set);
+               pthread_sigmask(SIG_SETMASK, &set, &old_set);
+
                if (pthread_create(&h->read_thr, NULL, read_thread, h) != 0) {
+                       pthread_sigmask(SIG_SETMASK, &old_set, NULL);
                        mutex_unlock(&h->request_mutex);
                        return false;
                }
                h->read_thr_exists = 1;
+               pthread_sigmask(SIG_SETMASK, &old_set, NULL);
        }
        mutex_unlock(&h->request_mutex);
 #endif

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.