This is the mail archive of the
pthreads-win32@sourceware.cygnus.com
mailing list for the pthreas-win32 project.
Asynchronous cancel
- To: pthreads-win32@sourceware.cygnus.com
- Subject: Asynchronous cancel
- From: Rajiv K Shukla <rshukla@vin.bellcore.com>
- Date: Tue, 10 Aug 1999 14:25:50 MDT
- Full-Name: Rajiv K Shukla
Hello All,
Sorry if the question has been asked before. We're trying to see if we
could use the pthreads-win32 package to port our code to NT. It's been
fine so far but we have hit a snag. It seems that
pthread_setcanceltype doesn't really do anything. It sets an integer
variable cancelType (which is part of the pthread_t structure) but the
flag is used no where. Looks like the only way to cancel a thread is
to call pthread_cancel and within the cancelled thread call
pthread_testcancel. But we'd like to be able to cancel a thread
asynchronously, e.g one of our thread sleeps for a configurable amount
of time and it could be set pretty high, 1 hour, or 10 hours, or
whatever. If within the thread I need to call pthread_testcancel in
order to be cancelled then it's a problem. We'd have to wait that much
time before we're even able to call pthread_testcancel.
I'd appreciate any suggestion that you may have.
Thank you,
-- Rajiv Shukla