Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Aug 2019 19:53:50 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351349 - head/lib/libthr/thread
Message-ID:  <201908211953.x7LJroaw021064@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Aug 21 19:53:50 2019
New Revision: 351349
URL: https://svnweb.freebsd.org/changeset/base/351349

Log:
  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

Modified:
  head/lib/libthr/thread/thr_cancel.c
  head/lib/libthr/thread/thr_init.c
  head/lib/libthr/thread/thr_private.h

Modified: head/lib/libthr/thread/thr_cancel.c
==============================================================================
--- head/lib/libthr/thread/thr_cancel.c	Wed Aug 21 19:35:04 2019	(r351348)
+++ head/lib/libthr/thread/thr_cancel.c	Wed Aug 21 19:53:50 2019	(r351349)
@@ -43,6 +43,8 @@ __weak_reference(_thr_setcanceltype, pthread_setcancel
 __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 mayca
 }
 
 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);
 }

Modified: head/lib/libthr/thread/thr_init.c
==============================================================================
--- head/lib/libthr/thread/thr_init.c	Wed Aug 21 19:35:04 2019	(r351348)
+++ head/lib/libthr/thread/thr_init.c	Wed Aug 21 19:53:50 2019	(r351349)
@@ -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)},

Modified: head/lib/libthr/thread/thr_private.h
==============================================================================
--- head/lib/libthr/thread/thr_private.h	Wed Aug 21 19:35:04 2019	(r351348)
+++ head/lib/libthr/thread/thr_private.h	Wed Aug 21 19:53:50 2019	(r351349)
@@ -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 *);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908211953.x7LJroaw021064>