* 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.
This commit is contained in:
parent
2ca9ed527e
commit
dacf4be3fa
@ -1,3 +1,10 @@
|
|||||||
|
2012-05-23 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2012-05-23 Corinna Vinschen <corinna@vinschen.de>
|
2012-05-23 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler.h (refcnt): Add i interlocked. Explain why.
|
* fhandler.h (refcnt): Add i interlocked. Explain why.
|
||||||
|
@ -1069,9 +1069,6 @@ pthread::pop_cleanup_handler (int const execute)
|
|||||||
|
|
||||||
mutex.lock ();
|
mutex.lock ();
|
||||||
|
|
||||||
/* We will no honor cancels since the thread is exiting. */
|
|
||||||
cancelstate = PTHREAD_CANCEL_DISABLE;
|
|
||||||
|
|
||||||
if (cleanup_stack != NULL)
|
if (cleanup_stack != NULL)
|
||||||
{
|
{
|
||||||
__pthread_cleanup_handler *handler = cleanup_stack;
|
__pthread_cleanup_handler *handler = cleanup_stack;
|
||||||
@ -1087,6 +1084,9 @@ pthread::pop_cleanup_handler (int const execute)
|
|||||||
void
|
void
|
||||||
pthread::pop_all_cleanup_handlers ()
|
pthread::pop_all_cleanup_handlers ()
|
||||||
{
|
{
|
||||||
|
/* We will no honor cancels since the thread is exiting. */
|
||||||
|
cancelstate = PTHREAD_CANCEL_DISABLE;
|
||||||
|
|
||||||
while (cleanup_stack != NULL)
|
while (cleanup_stack != NULL)
|
||||||
pop_cleanup_handler (1);
|
pop_cleanup_handler (1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user