diff options
Diffstat (limited to 'lib/libthr/thread')
-rw-r--r-- | lib/libthr/thread/thr_cancel.c | 12 | ||||
-rw-r--r-- | lib/libthr/thread/thr_init.c | 4 | ||||
-rw-r--r-- | lib/libthr/thread/thr_private.h | 3 |
3 files changed, 17 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_cancel.c b/lib/libthr/thread/thr_cancel.c index cd456b7..89f0ee1 100644 --- a/lib/libthr/thread/thr_cancel.c +++ b/lib/libthr/thread/thr_cancel.c @@ -162,3 +162,15 @@ _thr_cancel_leave(struct pthread *curthread, int maycancel) !THR_IN_CRITICAL(curthread) && maycancel)) _pthread_exit(PTHREAD_CANCELED); } + +void +_pthread_cancel_enter(int maycancel) +{ + _thr_cancel_enter2(_get_curthread(), maycancel); +} + +void +_pthread_cancel_leave(int maycancel) +{ + _thr_cancel_leave(_get_curthread(), maycancel); +} diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 56541a8..e8a01d3 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -248,7 +248,9 @@ static pthread_func_t jmp_table[][2] = { {DUAL_ENTRY(_pthread_sigmask)}, /* PJT_SIGMASK */ {DUAL_ENTRY(_pthread_testcancel)}, /* PJT_TESTCANCEL */ {DUAL_ENTRY(__pthread_cleanup_pop_imp)},/* PJT_CLEANUP_POP_IMP */ - {DUAL_ENTRY(__pthread_cleanup_push_imp)}/* PJT_CLEANUP_PUSH_IMP */ + {DUAL_ENTRY(__pthread_cleanup_push_imp)},/* PJT_CLEANUP_PUSH_IMP */ + {DUAL_ENTRY(_pthread_cancel_enter)}, /* PJT_CANCEL_ENTER */ + {DUAL_ENTRY(_pthread_cancel_leave)} /* PJT_CANCEL_LEAVE */ }; static int init_once = 0; diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index a42b4ec..e5a82b9 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -716,7 +716,8 @@ int _sched_yield(void); void _pthread_cleanup_push(void (*)(void *), void *); void _pthread_cleanup_pop(int); void _pthread_exit_mask(void *status, sigset_t *mask) __dead2 __hidden; - +void _pthread_cancel_enter(int maycancel); +void _pthread_cancel_leave(int maycancel); /* #include <fcntl.h> */ #ifdef _SYS_FCNTL_H_ |