Re: [c++-pthreads] Re: thread-safety definition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [c++-pthreads] Re: thread-safety definition
- To: Fergus Henderson <fjh@xxxxxxxxxxx>
- Subject: Re: [c++-pthreads] Re: thread-safety definition
- From: Alexander Terekhov <boo@xxxxxxxxxxx>
- Date: Mon, 12 Jan 2004 14:20:42 +0100
Fergus Henderson wrote:
[...]
> > This cannot happen if cancellation is automagically disabled during
> > execution of (all) destructors, along with the stack unwinding code
> > that is performed during exception processing.
>
> If all cleanup is done via destructors (or pthread_cleanup_push,
> which can be handled similarly), you are right.
AFAIK, POSIX doesn't disable cancellation when thread cleanup handler
is invoked by pthread_cleanup_pop() call with a non-zero execute
argument (cancellation is disabled when the thread exits [that is,
calls pthread_exit()] or acts upon a cancellation request delivery).
I do it "manually".
regards,
alexander.