This is the mail archive of the
mailing list for the pthreas-win32 project.
RE: Cancellation points
- From: "Alexander Terekhov" <TEREKHOV at de dot ibm dot com>
- To: pthreads-win32 at sources dot redhat dot com
- Date: Fri, 20 Dec 2002 01:53:33 +0100
- Subject: RE: Cancellation points
Simon Gerblich wrote:
> Is it correct if I put pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,
> after the small piece of code where I don't want a cancelation point?
It's correct as long as you use it properly; with proper arguments.
AFAICS, the use of null pointer for "oldstate"/"oldtype" is incorrect.
Sent by: firstname.lastname@example.org
Subject: RE: Cancellation points
>> pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL)
>that's incorrect. Don't do this.
Is it correct if I put pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL)
after the small piece of code where I don't want a cancelation point? I
aware that if I start using pthread_setcancelstate() in my code I should
take care to use the "oldstate" as described in the RATIONALE and restore
the state correctly.
I was only using pthread_setcancelstate to confirm if there was a problem
with the pthread_mutex_lock() function in the 2002-11-04 snapshot.