This is the mail archive of the
mailing list for the pthreas-win32 project.
Re: pthread_cancel doesn't work
- From: pankaj bathwal <pbathwal at yahoo dot com>
- To: ssundaragopalan at hss dot hns dot com
- Cc: pthreads-win32 at sources dot redhat dot com
- Date: Sun, 17 Nov 2002 22:26:16 -0800 (PST)
- Subject: Re: pthread_cancel doesn't work
Are there any system define cancellation points like
sleep, pthread_cond_wait, read, write etc
When did thread actually get cancelled???
When a running thread encounter a cancellation point
after pthread_cancel is called???
Or if a thread gets cancel when we are in system a
system define canecllation point??
--- firstname.lastname@example.org wrote:
> Hi pankaj,
> In Windows, threads get cancelled only in
> CANCELLATION POINTS.
> So you *cannot* expect your thread to get cancelled
> as soon as you cancel
> the thread
> by calling pthread_cancel. So,unless it comes across
> a cancellation point
> it wont get cancelled.
> I suggest you to do a explicit pthread_testcancel()
> in your thread which is
> a defined cancelleation point
> and the thread will relinquish when it encounters
> some possible scenarios where a thread might not get
> cancelled are
> > Listening in a socket
> > waiting for a user input from console(getchar())
> pankaj bathwal <email@example.com> on 11/16/2002
> 11:17:31 AM
> To: firstname.lastname@example.org
> cc: (bcc: Srikanth Sundaragopalan/HSSBLR)
> Subject: pthread_cancel doesn't work
> I am trying to cancel a running thread.
> I an using "pthread_cancel" function.
> I have set cancel state as PTHREAD_CANCEL_ENABLE
> function "pthread_setcancelstate" but execution of
> thread does not stop.
> what's wrong??
> Do I have to something more??
> Can I have a sample code??
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site