From b6c868e44558c6467f842814750506503a2453c2 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 25 Oct 1999 16:05:34 +0000 Subject: Patch from Charles-Antoine Gauthier to initialize the pthread cancellation fields. This is a patch to _POSIX_Threads_Create_extension that fixes the problem. --- c/src/exec/posix/src/pthread.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'c/src/exec/posix') diff --git a/c/src/exec/posix/src/pthread.c b/c/src/exec/posix/src/pthread.c index 2a529ba49a..49f6273a71 100644 --- a/c/src/exec/posix/src/pthread.c +++ b/c/src/exec/posix/src/pthread.c @@ -148,6 +148,14 @@ boolean _POSIX_Threads_Create_extension( api->schedparam.sched_priority = _POSIX_Priority_From_core( created->current_priority ); + /* + * POSIX 1003.1 1996, 18.2.2.2 + */ + api->cancelation_requested = 0; + api->cancelability_state = PTHREAD_CANCEL_ENABLE; + api->cancelability_type = PTHREAD_CANCEL_DEFERRED; + _Chain_Initialize_empty (&api->Cancellation_Handlers); + /* * If the thread is not a posix thread, then all posix signals are blocked * by default. -- cgit v1.2.3