Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178210517
D62265.1796262716.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D62265.1796262716.diff
View Options
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c
--- a/lib/libthr/thread/thr_create.c
+++ b/lib/libthr/thread/thr_create.c
@@ -296,7 +296,7 @@
exterrctl(EXTERRCTL_ENABLE, 0, &curthread->uexterr);
/* Run the current thread's start routine with argument: */
- _pthread_exit(curthread->start_routine(curthread->arg));
+ _thr_exit_return(curthread->start_routine(curthread->arg));
/* This point should never be reached. */
PANIC("Thread has resumed after exit");
diff --git a/lib/libthr/thread/thr_exit.c b/lib/libthr/thread/thr_exit.c
--- a/lib/libthr/thread/thr_exit.c
+++ b/lib/libthr/thread/thr_exit.c
@@ -45,6 +45,7 @@
#include "libc_private.h"
#include "thr_private.h"
+static void exit_common(void *status, sigset_t *mask, bool unwind) __dead2;
static void exit_thread(void) __dead2;
__weak_reference(_Tthr_exit, pthread_exit);
@@ -208,6 +209,18 @@
void
_pthread_exit_mask(void *status, sigset_t *mask)
+{
+ exit_common(status, mask, true);
+}
+
+void
+_thr_exit_return(void *status)
+{
+ exit_common(status, NULL, false);
+}
+
+static void
+exit_common(void *status, sigset_t *mask, bool unwind __unused)
{
struct pthread *curthread = _get_curthread();
@@ -236,6 +249,8 @@
/* Save the return value: */
curthread->ret = status;
#ifdef _PTHREAD_FORCED_UNWIND
+ if (!unwind)
+ goto cleanup;
#ifdef PIC
thread_uw_init();
diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h
--- a/lib/libthr/thread/thr_private.h
+++ b/lib/libthr/thread/thr_private.h
@@ -876,6 +876,7 @@
void _pthread_cleanup_push(void (*)(void *), void *);
void _pthread_cleanup_pop(int);
void _pthread_exit_mask(void *status, sigset_t *mask) __dead2 __hidden;
+void _thr_exit_return(void *status) __dead2 __hidden;
#ifndef _LIBC_PRIVATE_H_
void _pthread_cancel_enter(int maycancel);
void _pthread_cancel_leave(int maycancel);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 3, 1:51 AM (18 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42137934
Default Alt Text
D62265.1796262716.diff (1 KB)
Attached To
Mode
D62265: libthr: Skip unwinding for thread normal returrn
Attached
Detach File
Event Timeline