Blame xen.xs_watch.stacksize.patch
|
|
501230b |
--- xen-4.6.3/tools/xenstore/xs.c.orig 2016-06-20 13:08:22.000000000 +0100
|
|
|
501230b |
+++ xen-4.6.3/tools/xenstore/xs.c 2016-07-10 21:05:57.082217329 +0100
|
|
|
501230b |
@@ -733,6 +733,7 @@
|
|
|
501230b |
if (!h->read_thr_exists) {
|
|
|
501230b |
sigset_t set, old_set;
|
|
|
501230b |
pthread_attr_t attr;
|
|
|
501230b |
+ int ptret;
|
|
|
501230b |
|
|
|
501230b |
if (pthread_attr_init(&attr) != 0) {
|
|
|
501230b |
mutex_unlock(&h->request_mutex);
|
|
|
501230b |
@@ -747,7 +748,12 @@
|
|
|
501230b |
sigfillset(&set);
|
|
|
501230b |
pthread_sigmask(SIG_SETMASK, &set, &old_set);
|
|
|
501230b |
|
|
|
501230b |
- if (pthread_create(&h->read_thr, &attr, read_thread, h) != 0) {
|
|
|
501230b |
+ ptret = pthread_create(&h->read_thr, &attr, read_thread, h);
|
|
|
501230b |
+ if ( (ptret == EINVAL) && (pthread_attr_setstacksize(&attr, READ_THREAD_STACKSIZE + (8*1024)) == 0) ) {
|
|
|
501230b |
+ /* have a second try with the bigger stacksize */
|
|
|
501230b |
+ ptret = pthread_create(&h->read_thr, &attr, read_thread, h);
|
|
|
501230b |
+ }
|
|
|
501230b |
+ if (ptret != 0) {
|
|
|
501230b |
pthread_sigmask(SIG_SETMASK, &old_set, NULL);
|
|
|
501230b |
pthread_attr_destroy(&attr);
|
|
|
501230b |
mutex_unlock(&h->request_mutex);
|