pthread_setcancel man page on Ultrix

Man page or keyword search:  
man Server   3690 pages
apropos Keyword Search (all sections)
Output format
Ultrix logo
[printable version]

pthread_setcancel(3thr)				       pthread_setcancel(3thr)

Name
       pthread_setcancel  -  Enables  or disables the current thread's general
       cancelability.

Syntax
       #include <pthread.h>

       int pthread_setcancel (state)
       int state;

Arguments
       state   State of general cancelability to set for the  calling  thread.
	       Valid values are as follows:

	       Value	    Description
	       CANCEL_ON    Asynchronous cancelability
			    is enabled.

	       CANCEL_OFF   Asynchronous cancelability
			    is disabled.

Description
       This  routine enables or disables the current thread's general cancela‐
       bility and returns the previous cancelability state.

       When general cancelability is set to CANCEL_OFF,	 a  cancel  cannot  be
       delivered  to  the  thread,  even  if a cancelable routine is called or
       asynchronous cancelability is enabled.

       When a thread is created, the default general  cancelability  state  is
       CANCEL_ON.

   Possible Dangers of Disabling Cancelability
       The  most  important  use  of cancels is to ensure that indefinite wait
       operations are terminated.  For example, a thread waiting on some  net‐
       work connection, which may take days to respond (or may never respond),
       is normally made cancelable.

       However, when cancelability is  disabled,  no  routine  is  cancelable.
       Waits  must be completed normally before a cancel can be delivered.  As
       a result, the program stops but does not crash and the user  is	unable
       to cancel the operation.

       When  disabling	cancelability, be sure that no long waits can occur or
       that it is necessary for other reasons to  defer	 cancels  around  that
       particular region of code.

Return Values
       On  successful  completion,  this routine returns the previous state of
       general cancelability.

       If an error condition occurs, this routine returns -1 and sets errno to
       the corresponding error value.  Possible return values are as follows.

       Return	Error	   Description
       0		   Successful  comple‐
			   tion.

       -1	[EINVAL]   The specified state
			   is not CANCEL_ON or
			   CANCEL_OFF.

						       pthread_setcancel(3thr)
[top]

List of man pages available for Ultrix

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net