Loading...
Searching...
No Matches
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.
 
int pthread_setcanceltype (int type, int *oldtype)
 Cancellation point are not supported, yet.
 
int pthread_cancel (pthread_t th)
 Tells a pthread that it should exit.
 
void pthread_testcancel (void)
 Exit the current pthread if pthread_cancel() was called for this thread before.
 

Macro Definition Documentation

◆ PTHREAD_CANCEL_ASYNCHRONOUS

#define PTHREAD_CANCEL_ASYNCHRONOUS   1

Definition at line 29 of file pthread_cancellation.h.

◆ PTHREAD_CANCEL_DEFERRED

#define PTHREAD_CANCEL_DEFERRED   0

Definition at line 28 of file pthread_cancellation.h.

◆ PTHREAD_CANCEL_DISABLE

#define PTHREAD_CANCEL_DISABLE   0

Definition at line 25 of file pthread_cancellation.h.

◆ PTHREAD_CANCEL_ENABLE

#define PTHREAD_CANCEL_ENABLE   1

Definition at line 26 of file pthread_cancellation.h.

◆ PTHREAD_CANCELED

#define PTHREAD_CANCELED   ((void *) -2)

Thread exit status after a canceled thread has terminated.

Definition at line 34 of file pthread_cancellation.h.

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.