pthread_cancellation.h File Reference

Thread cancellation features. More...

Detailed Description

Thread cancellation features.

Note
None of these functions are implemented, yet.
Do not include this header file directly, but pthread.h.

Definition in file pthread_cancellation.h.

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define PTHREAD_CANCEL_DISABLE   0
 
#define PTHREAD_CANCEL_ENABLE   1
 
#define PTHREAD_CANCEL_DEFERRED   0
 
#define PTHREAD_CANCEL_ASYNCHRONOUS   1
 
#define PTHREAD_CANCELED   ((void *) -2)
 Thread exit status after a canceled thread has terminated.
 
int pthread_setcancelstate (int state, int *oldstate)
 Cancellation point are not supported, yet. More...
 
int pthread_setcanceltype (int type, int *oldtype)
 Cancellation point are not supported, yet. More...
 
int pthread_cancel (pthread_t th)
 Tells a pthread that it should exit. More...
 
void pthread_testcancel (void)
 Exit the current pthread if pthread_cancel() was called for this thread before. More...
 

Function Documentation

◆ pthread_cancel()

int pthread_cancel ( pthread_t  th)

Tells a pthread that it should exit.

Note
Cancellation points are not supported, yet.

A pthread th can call pthread_testcancel(). If pthread_cancel(th) was called before, it will exit then.

Parameters
[in]thPthread to tell that it should cancel.
Returns
-1, this invocation fails

◆ pthread_setcancelstate()

int pthread_setcancelstate ( int  state,
int *  oldstate 
)

Cancellation point are not supported, yet.

Parameters
[in]stateUnused
[out]oldstateUnused
Returns
-1, this invocation fails

◆ pthread_setcanceltype()

int pthread_setcanceltype ( int  type,
int *  oldtype 
)

Cancellation point are not supported, yet.

Parameters
[in]typeUnused
[out]oldtypeUnused
Returns
-1, this invocation fails

◆ pthread_testcancel()

void pthread_testcancel ( void  )

Exit the current pthread if pthread_cancel() was called for this thread before.

If pthread_cancel() called before, the current thread exits with with the code PTHREAD_CANCELED.