*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> pthread_setcancelstate (3)              
Title
Content
Arch
Section
 

pthread_setcancelstate(3)

Contents


NAME    [Toc]    [Back]

       pthread_setcancelstate  - Sets the calling thread's cancelability
 state

SYNOPSIS    [Toc]    [Back]

       #include <pthread.h>

       int pthread_setcancelstate(
               int state,
               int *oldstate );

LIBRARY    [Toc]    [Back]

       DECthreads POSIX 1003.1c Library (libpthread.so)

STANDARDS    [Toc]    [Back]

       Interfaces documented on this reference  page  conform  to
       industry standards as follows:

       IEEE  Std  1003.1c-1995,  POSIX System Application Program
       Interface

PARAMETERS    [Toc]    [Back]

       State of general cancelability  to  set  for  the  calling
       thread.  The  following  are  valid  cancel  state values:
       PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_DISABLE Previous cancelability
 state for the calling thread.

DESCRIPTION    [Toc]    [Back]

       This routine sets the current thread's cancelability state
       and returns the calling  thread's  previous  cancelability
       state in oldstate.

       When cancelability state is set to PTHREAD_CANCEL_DISABLE,
       a cancellation request cannot be delivered to the  thread,
       even  if  a  cancelable  routine is called or asynchronous
       cancelability type is enabled.

       When a thread is created, the default cancelability  state
       is PTHREAD_CANCEL_ENABLE.

   Possible Problems When Disabling Cancelability    [Toc]    [Back]
       The most important use of thread cancellation is to ensure
       that indefinite wait operations are terminated. For  example,
 a thread that waits on some network connection, which
       can  possibly  take  days  to  respond  (or  might   never
       respond), should be made cancelable.

       When  a  thread's cancelability is disabled, no routine in
       that thread is cancelable. As a result, the user is unable
       to  cancel  the  operation  performed by that thread. When
       disabling cancelability, be sure that no  long  waits  can
       occur  or  that it is necessary for other reasons to defer
       cancellation requests around  that  particular  region  of
       code.








RETURN VALUES    [Toc]    [Back]

       On successful completion, this routine returns the calling
       thread's previous  cancelability  state  in  the  location
       specified by the oldstate argument.

       If  an  error  condition  occurs,  this routine returns an
       integer value  indicating  the  type  of  error.  Possible
       return  values are as follows: Successful completion.  The
       specified   state   is   not   PTHREAD_CANCEL_ENABLE    or
       PTHREAD_CANCEL_DISABLE.

ERRORS    [Toc]    [Back]

       None

SEE ALSO    [Toc]    [Back]

      
      
       Functions:   pthread_cancel(3),  pthread_setcanceltype(3),
       pthread_testcancel(3)

       Manuals: Guide to DECthreads and Programmer's Guide



                                        pthread_setcancelstate(3)
[ Back ]
 Similar pages
Name OS Title
tis_setcancelstate Tru64 Changes the calling thread's cancelability state
pthread_setcancelstate OpenBSD set cancelability state
pthread_setcanceltype OpenBSD set cancelability state
pthread_testcancel OpenBSD set cancelability state
pthread_setcancelstate FreeBSD set cancelability state
pthread_testcancel FreeBSD set cancelability state
pthread_setcanceltype FreeBSD set cancelability state
pthread_setcancelstate IRIX manage cancelability of a thread
pthread_join Tru64 Causes the calling thread to wait for the termination of the specified thread
pthread_setcanceltype Tru64 Sets the current thread's cancelability type
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service