Fix _pthread_cancel_enter() and _pthread_cancel_leave() jmptable entries.

PR:	240022
Reported by:	Andrew Gierth <andrew@tao11.riddles.org.uk>
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
This commit is contained in:
Konstantin Belousov 2019-08-21 19:53:50 +00:00
parent 6bc13e042f
commit 65174f684c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351349
3 changed files with 8 additions and 4 deletions

View File

@ -43,6 +43,8 @@ __weak_reference(_thr_setcanceltype, pthread_setcanceltype);
__weak_reference(_thr_setcanceltype, _pthread_setcanceltype);
__weak_reference(_Tthr_testcancel, pthread_testcancel);
__weak_reference(_Tthr_testcancel, _pthread_testcancel);
__weak_reference(_Tthr_cancel_enter, _pthread_cancel_enter);
__weak_reference(_Tthr_cancel_leave, _pthread_cancel_leave);
static inline void
testcancel(struct pthread *curthread)
@ -173,13 +175,13 @@ _thr_cancel_leave(struct pthread *curthread, int maycancel)
}
void
_pthread_cancel_enter(int maycancel)
_Tthr_cancel_enter(int maycancel)
{
_thr_cancel_enter2(_get_curthread(), maycancel);
}
void
_pthread_cancel_leave(int maycancel)
_Tthr_cancel_leave(int maycancel)
{
_thr_cancel_leave(_get_curthread(), maycancel);
}

View File

@ -265,8 +265,8 @@ static pthread_func_t jmp_table[][2] = {
[PJT_TESTCANCEL] = {DUAL_ENTRY(_Tthr_testcancel)},
[PJT_CLEANUP_POP_IMP] = {DUAL_ENTRY(__thr_cleanup_pop_imp)},
[PJT_CLEANUP_PUSH_IMP] = {DUAL_ENTRY(__thr_cleanup_push_imp)},
[PJT_CANCEL_ENTER] = {DUAL_ENTRY(_thr_cancel_enter)},
[PJT_CANCEL_LEAVE] = {DUAL_ENTRY(_thr_cancel_leave)},
[PJT_CANCEL_ENTER] = {DUAL_ENTRY(_Tthr_cancel_enter)},
[PJT_CANCEL_LEAVE] = {DUAL_ENTRY(_Tthr_cancel_leave)},
[PJT_MUTEX_CONSISTENT] = {DUAL_ENTRY(_Tthr_mutex_consistent)},
[PJT_MUTEXATTR_GETROBUST] = {DUAL_ENTRY(_thr_mutexattr_getrobust)},
[PJT_MUTEXATTR_SETROBUST] = {DUAL_ENTRY(_thr_mutexattr_setrobust)},

View File

@ -1022,6 +1022,8 @@ void __thr_cleanup_pop_imp(int);
void _thr_cleanup_push(void (*)(void *), void *);
void _thr_cleanup_pop(int);
void _Tthr_testcancel(void);
void _Tthr_cancel_enter(int);
void _Tthr_cancel_leave(int);
int _thr_cancel(pthread_t);
int _thr_atfork(void (*)(void), void (*)(void), void (*)(void));
int _thr_attr_destroy(pthread_attr_t *);