MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Standard C Library Functions            pthreadsetcanceltype(3C)



NAME
     pthreadsetcanceltype - set cancellation type of a thread

SYNOPSIS
     cc -mt [ flag... ] file... -lpthread [ library... ]
     #include 

     int pthreadsetcanceltype(int type, int *oldtype);


DESCRIPTION
     The pthreadsetcanceltype()  function  atomically  sets  the
     calling  thread's  cancellation  type  to the specified type
     and, if  oldtype is not  NUL, stores the previous cancella-
     tion  type  in  oldtype. The  type can be either of the fol-
     lowing:

     PTHREADCANCELDEFERED

         This  is  the  default.  When  cancellation  is  enabled
         (enabled cancellation is also the default), cancellation
         occurs when the target  thread  reaches  a  cancellation
         point and a cancel is pending. When cancellation is dis-
         abled, all cancellation requests to  the  target  thread
         are held pending.


     PTHREADCANCELASYNCHRONOUS

         When   cancellation   is   enabled,   receipt    of    a
         pthreadcancel(3C)  call  causes immediate cancellation.
         When cancellation is disabled, all cancellation requests
         to  the  target thread are held pending; as soon as can-
         cellation is re-enabled, pending cancellations are  exe-
         cuted immediately.



     See cancellation(5) for the  definition  of  a  cancellation
     point   and  a  discussion  of  cancellation  concepts.  See
     pthreadsetcancelstate(3C) for explanations of enabling  and
     disabling cancellation.


     The pthreadsetcanceltype() function is a cancellation point
     if  type  is called with PTHREADCANCELASYNCHRONOUS and the
     cancellation state is PTHREADCANCELENABLE.

RETURN VALUES
     Upon  successful  completion,  the   pthreadsetcanceltype()
     function  returns  0. Otherwise, an error number is returned
     to indicate the error.



SunOS 5.11          Last change: 23 Mar 2005                    1






Standard C Library Functions            pthreadsetcanceltype(3C)



ERORS
     The  pthreadsetcanceltype() function will fail if:

     EINVAL     The specified type is not PTHREADCANCELDEFERED
                or PTHREADCANCELASYNCHRONOUS.


ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Standard                    
    
     MT-Level                     MT-Safe                     
    


SEE ALSO
     pthreadcancel(3C),                 pthreadcleanuppop(3C),
     pthreadcleanuppush(3C),                  pthreadexit(3C),
     pthreadjoin(3C),                pthreadsetcancelstate(3C),
     pthreadtestcancel(3C), setjmp(3C), attributes(5), cancella-
     tion(5), condition(5), standards(5)



























SunOS 5.11          Last change: 23 Mar 2005                    2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™