LibC: Implement pthread cancelation
This code is not tested at all but it looks correct xD
This commit is contained in:
@@ -32,10 +32,13 @@ struct uthread
|
||||
struct _pthread_cleanup_t* cleanup_stack;
|
||||
pthread_t id;
|
||||
int errno_;
|
||||
int cancel_type;
|
||||
int cancel_state;
|
||||
int canceled;
|
||||
uintptr_t dtv[];
|
||||
};
|
||||
|
||||
#define PTHREAD_CANCELED 1
|
||||
#define PTHREAD_CANCELED (void*)1
|
||||
|
||||
#define PTHREAD_CANCEL_ASYNCHRONOUS 1
|
||||
#define PTHREAD_CANCEL_DEFERRED 0
|
||||
@@ -43,6 +46,9 @@ struct uthread
|
||||
#define PTHREAD_CANCEL_DISABLE 0
|
||||
#define PTHREAD_CANCEL_ENABLE 1
|
||||
|
||||
// cancellation points
|
||||
// https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_16_09_05_02
|
||||
|
||||
#define PTHREAD_PRIO_INHERIT 1
|
||||
#define PTHREAD_PRIO_NONE 0
|
||||
#define PTHREAD_PRIO_PROTECT 2
|
||||
|
||||
@@ -106,7 +106,8 @@ struct sigevent
|
||||
#define SIGXCPU 27
|
||||
#define SIGXFSZ 28
|
||||
#define SIGWINCH 29
|
||||
#define SIGRTMIN 30
|
||||
#define SIGCANCEL 30
|
||||
#define SIGRTMIN 31
|
||||
#define SIGRTMAX (SIGRTMIN+32)
|
||||
|
||||
#define NSIG SIGRTMAX
|
||||
|
||||
Reference in New Issue
Block a user