Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144826487
D21088.id60205.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D21088.id60205.diff
View Options
Index: lib/libthr/thread/thr_clean.c
===================================================================
--- lib/libthr/thread/thr_clean.c
+++ lib/libthr/thread/thr_clean.c
@@ -49,6 +49,10 @@
__weak_reference(_pthread_cleanup_push, pthread_cleanup_push);
__weak_reference(_pthread_cleanup_pop, pthread_cleanup_pop);
+/* help static linking when libc symbols have preference */
+__weak_reference(__pthread_cleanup_push_imp, __pthread_cleanup_push_imp1);
+__weak_reference(__pthread_cleanup_pop_imp, __pthread_cleanup_pop_imp1);
+
void
__pthread_cleanup_push_imp(void (*routine)(void *), void *arg,
struct _pthread_cleanup_info *info)
Index: lib/libthr/thread/thr_init.c
===================================================================
--- lib/libthr/thread/thr_init.c
+++ lib/libthr/thread/thr_init.c
@@ -202,6 +202,12 @@
#define DUAL_ENTRY(entry) \
(pthread_func_t)entry, (pthread_func_t)entry
+void __pthread_cleanup_push_imp1(void (*)(void *), void *,
+ struct _pthread_cleanup_info *);
+void __pthread_cleanup_pop_imp1(int);
+void _thr_cancel_enter(struct pthread *);
+void _thr_cancel_leave(struct pthread *, int);
+
static pthread_func_t jmp_table[][2] = {
{DUAL_ENTRY(_pthread_atfork)}, /* PJT_ATFORK */
{DUAL_ENTRY(_pthread_attr_destroy)}, /* PJT_ATTR_DESTROY */
@@ -236,7 +242,7 @@
{DUAL_ENTRY(_pthread_equal)}, /* PJT_EQUAL */
{DUAL_ENTRY(_pthread_exit)}, /* PJT_EXIT */
{DUAL_ENTRY(_pthread_getspecific)}, /* PJT_GETSPECIFIC */
- {DUAL_ENTRY(_pthread_join)}, /* PJT_JOIN */
+ {DUAL_ENTRY(_thr_join)}, /* PJT_JOIN */
{DUAL_ENTRY(_pthread_key_create)}, /* PJT_KEY_CREATE */
{DUAL_ENTRY(_pthread_key_delete)}, /* PJT_KEY_DELETE*/
{DUAL_ENTRY(_pthread_kill)}, /* PJT_KILL */
@@ -265,10 +271,10 @@
{DUAL_ENTRY(_pthread_setspecific)}, /* PJT_SETSPECIFIC */
{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_cancel_enter)}, /* PJT_CANCEL_ENTER */
- {DUAL_ENTRY(_pthread_cancel_leave)}, /* PJT_CANCEL_LEAVE */
+ {DUAL_ENTRY(__pthread_cleanup_pop_imp1)},/* PJT_CLEANUP_POP_IMP */
+ {DUAL_ENTRY(__pthread_cleanup_push_imp1)},/* PJT_CLEANUP_PUSH_IMP */
+ {DUAL_ENTRY(_thr_cancel_enter)}, /* PJT_CANCEL_ENTER */
+ {DUAL_ENTRY(_thr_cancel_leave)}, /* PJT_CANCEL_LEAVE */
{DUAL_ENTRY(_pthread_mutex_consistent)},/* PJT_MUTEX_CONSISTENT */
{DUAL_ENTRY(_pthread_mutexattr_getrobust)},/* PJT_MUTEXATTR_GETROBUST */
{DUAL_ENTRY(_pthread_mutexattr_setrobust)},/* PJT_MUTEXATTR_SETROBUST */
Index: lib/libthr/thread/thr_join.c
===================================================================
--- lib/libthr/thread/thr_join.c
+++ lib/libthr/thread/thr_join.c
@@ -40,7 +40,8 @@
const struct timespec *abstime);
static int join_common(pthread_t, void **, const struct timespec *);
-__weak_reference(_pthread_join, pthread_join);
+__weak_reference(_thr_join, pthread_join);
+__weak_reference(_thr_join, _pthread_join);
__weak_reference(_pthread_timedjoin_np, pthread_timedjoin_np);
static void backout_join(void *arg)
@@ -54,7 +55,7 @@
}
int
-_pthread_join(pthread_t pthread, void **thread_return)
+_thr_join(pthread_t pthread, void **thread_return)
{
return (join_common(pthread, thread_return, NULL));
}
Index: lib/libthr/thread/thr_private.h
===================================================================
--- lib/libthr/thread/thr_private.h
+++ lib/libthr/thread/thr_private.h
@@ -1013,6 +1013,8 @@
void __thr_malloc_prefork(struct pthread *curthread);
void __thr_malloc_postfork(struct pthread *curthread);
+int _thr_join(pthread_t, void **);
+
__END_DECLS
__NULLABILITY_PRAGMA_POP
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 14, 3:58 AM (11 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28685995
Default Alt Text
D21088.id60205.diff (3 KB)
Attached To
Mode
D21088: Avoid conflicts with libc symbols in libthr jump table.
Attached
Detach File
Event Timeline
Log In to Comment