This is the mail archive of the
pthreads-win32@sources.redhat.com
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
- Sensitivity:
Simon Gerblich wrote:
[...]
> 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?
It's correct as long as you use it properly; with proper arguments.
AFAICS, the use of null pointer for "oldstate"/"oldtype" is incorrect.
http://www.opengroup.org/onlinepubs/007904975/functions/pthread_setcancelstate.html
regards,
alexander.
Sent by: pthreads-win32-owner@sources.redhat.com
To: pthreads-win32@sources.redhat.com
cc:
Subject: RE: Cancellation points
>BTW,
>
>> pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL)
> ^^^^
>
>that's incorrect. Don't do this.
>
>regards,
>alexander.
alexander,
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
am
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.
Thanks,
Simon