From dacf4be3fa450920f16fe279e155e861f8cd258a Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 23 May 2012 13:18:34 +0000 Subject: * thread.cc (pthread::pop_cleanup_handler): Move setting the cancelstate to PTHREAD_CANCEL_DISABLE from here... (pthread::pop_all_cleanup_handlers): ...to here, otherwise any explicit call to pthread_cleanup_pop disables cancellation for this thread. --- winsup/cygwin/thread.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/thread.cc') diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index f7ba60a70..bb38ff3ed 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -1069,9 +1069,6 @@ pthread::pop_cleanup_handler (int const execute) mutex.lock (); - /* We will no honor cancels since the thread is exiting. */ - cancelstate = PTHREAD_CANCEL_DISABLE; - if (cleanup_stack != NULL) { __pthread_cleanup_handler *handler = cleanup_stack; @@ -1087,6 +1084,9 @@ pthread::pop_cleanup_handler (int const execute) void pthread::pop_all_cleanup_handlers () { + /* We will no honor cancels since the thread is exiting. */ + cancelstate = PTHREAD_CANCEL_DISABLE; + while (cleanup_stack != NULL) pop_cleanup_handler (1); } -- cgit v1.2.3