Add pthread_testcancel(), pthread_testcancel(), and definitiions for cancellation types.

This commit is contained in:
Gregory Nutt
2016-12-09 07:23:00 -06:00
parent 6224e47533
commit acaae12e8b
10 changed files with 274 additions and 14 deletions
+7 -1
View File
@@ -115,11 +115,16 @@
#define PTHREAD_DEFAULT_PRIORITY 100
/* Cancellation states returned by pthread_cancelstate() */
/* Cancellation states used by pthread_setcancelstate() */
#define PTHREAD_CANCEL_ENABLE (0)
#define PTHREAD_CANCEL_DISABLE (1)
/* Cancellation types used by pthread_setcanceltype() */
#define PTHREAD_CANCEL_DEFERRED (0)
#define PTHREAD_CANCEL_ASYNCHRONOUS (1)
/* Thread return value when a pthread is canceled */
#define PTHREAD_CANCELED ((FAR void*)ERROR)
@@ -340,6 +345,7 @@ int pthread_detach(pthread_t thread);
void pthread_exit(pthread_addr_t value) noreturn_function;
int pthread_cancel(pthread_t thread);
int pthread_setcancelstate(int state, FAR int *oldstate);
int pthread_setcanceltype(int type, FAR int *oldtype);
void pthread_testcancel(void);
/* A thread may set up cleanup functions to execut when the thread exits or