[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: a question about tst-cancel2



write() is a cancellation point ? 

man pthread_cancel(),  I could get the following line.

The following POSIX threads functions  are
cancellation points:
       pthread_join(3)
       pthread_cond_wait(3)
       pthread_cond_timedwait(3)
       pthread_testcancel(3)
       sem_wait(3)
       sigwait(3)
 All  other  POSIX threads functions are guaranteed not to be 
cancellation points. That is, they never perform cancellation 
in deferred cancellation mode.

By the way, I traced the pthread_cancel() in tst-cancel2. 
It only masked the pd->cancelhandling |= CANCELED_BITMASK,
instead of sending SIGCANCEL signal to the child thread. 

Do I miss sth? thanks. 

boris


> -----Original Message-----
> From: Saurabh Desai [mailto:sdesai austin ibm com]
> Sent: 2003?4?2? 1:18
> To: Hu, Boris
> Cc: NPTL list (E-mail)
> Subject: Re: a question about tst-cancel2
> 
> 
> "Hu, Boris" wrote:
> > 
> > thanks for your reply.  :)
> > 
> > yeah, pthread_testcancel() is a point to execute cancel buffer
> > code. But in tst-cancel2, there is no place to call
> > pthread_testcancel().  :(  So there must be another place
> > to call __do_cancel().
> > 
> > I have checked all places to call __do_cancel(),
> > init.c::sigcancel_handler()
> > _pthread_cleanup_pop_restore()
> > pthread_testcancel()
> > pthread_enable_asynccancel()
> > pthread_enable_asynccancel_2()
> > __libc_enable_asynccancel()
> > pthread_exit()
> > pthread_setcancelstate()
> > pthread_setcanceltype()
> > 
> > but I failed to find the tst-cancel2 to run one of them. :(
> > 
> In this case, it will run from sigcancel_handler(). Here the write()
> is a cancellation point and enables async-cancellation before it waits
> in kernel. The pthread_cancel sends SIGCANCEL signal and this
> handler gets called, which then calls __do_cancel.
> 
> - Saurabh
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]