summaryrefslogtreecommitdiff
path: root/create.c
diff options
context:
space:
mode:
authorrpj <rpj>2005-05-06 07:27:10 +0000
committerrpj <rpj>2005-05-06 07:27:10 +0000
commit7523c7c4d75652f67cd31cb123e1268790394c8b (patch)
tree0920ebf089ccb971e0878542f85486171a541a8a /create.c
parentcf42850c77554311e62d3780f6a36cbc38e5e002 (diff)
''
Diffstat (limited to 'create.c')
-rw-r--r--create.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/create.c b/create.c
index 919db2e..9e9388b 100644
--- a/create.c
+++ b/create.c
@@ -92,6 +92,7 @@ pthread_create (pthread_t * tid,
ThreadParms *parms = NULL;
long stackSize;
int priority;
+ pthread_t self;
/*
* Before doing anything, check that tid can be stored through
@@ -128,18 +129,23 @@ pthread_create (pthread_t * tid,
parms->start = start;
parms->arg = arg;
+#if defined(HAVE_SIGSET_T)
+
+ /*
+ * Threads inherit their initial sigmask from their creator thread.
+ */
+ self = pthread_self();
+ tp->sigmask = ((ptw32_thread_t *)self.p)->sigmask;
+
+#endif /* HAVE_SIGSET_T */
+
+
if (a != NULL)
{
stackSize = a->stacksize;
tp->detachState = a->detachstate;
priority = a->param.sched_priority;
-#if HAVE_SIGSET_T
-
- tp->sigmask = a->sigmask;
-
-#endif /* HAVE_SIGSET_T */
-
#if (THREAD_PRIORITY_LOWEST > THREAD_PRIORITY_NORMAL)
/* WinCE */
#else
@@ -164,7 +170,9 @@ pthread_create (pthread_t * tid,
* then the inherited priority could be the result of a temporary
* system adjustment. This is not the case for POSIX threads.
*/
- pthread_t self = pthread_self ();
+#if ! defined(HAVE_SIGSET_T)
+ self = pthread_self ();
+#endif
priority = ((ptw32_thread_t *) self.p)->sched_priority;
}