From 25c63f726e3ee9f01eefa8e1d8dd57d6582ae7ec Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 8 Jul 2016 21:09:17 +0900 Subject: [PATCH] eina thread - fix window build with sigprocmask fixes T4048 --- src/lib/eina/eina_thread.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/lib/eina/eina_thread.c b/src/lib/eina/eina_thread.c index a56bf80..0244ccb 100644 --- a/src/lib/eina/eina_thread.c +++ b/src/lib/eina/eina_thread.c @@ -34,7 +34,9 @@ #include #include -#include +#ifndef _WIN32 +# include +#endif #if defined(EINA_HAVE_PTHREAD_AFFINITY) || defined(EINA_HAVE_PTHREAD_SETNAME) #ifndef __linux__ @@ -58,8 +60,10 @@ _eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), voi { int err; pthread_attr_t attr; +#ifndef _WIN32 sigset_t oldset, newset; - +#endif + pthread_attr_init(&attr); if (affinity >= 0) { @@ -76,6 +80,7 @@ _eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), voi } /* setup initial locks */ +#ifndef _WIN32 sigemptyset(&newset); sigaddset(&newset, SIGPIPE); sigaddset(&newset, SIGALRM); @@ -86,12 +91,15 @@ _eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), voi sigaddset(&newset, SIGQUIT); sigaddset(&newset, SIGINT); sigaddset(&newset, SIGTERM); -#ifdef SIGPWR +# ifdef SIGPWR sigaddset(&newset, SIGPWR); -#endif +# endif sigprocmask(SIG_BLOCK, &newset, &oldset); +#endif err = pthread_create((pthread_t *)t, &attr, func, data); +#ifndef _WIN32 sigprocmask(SIG_SETMASK, &oldset, NULL); +#endif pthread_attr_destroy(&attr); if (err == 0) return EINA_TRUE; -- 2.7.4