Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151174844
D1038.id2168.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D1038.id2168.diff
View Options
Index: sys/kern/kern_thread.c
===================================================================
--- sys/kern/kern_thread.c
+++ sys/kern/kern_thread.c
@@ -44,6 +44,7 @@
#include <sys/smp.h>
#include <sys/sched.h>
#include <sys/sleepqueue.h>
+#include <sys/sysent.h>
#include <sys/selinfo.h>
#include <sys/turnstile.h>
#include <sys/ktr.h>
@@ -807,6 +808,12 @@
*/
if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) {
PROC_UNLOCK(p);
+ /*
+ * Let thread to do cleanup work before die.
+ */
+ if (__predict_false(p->p_sysent->sv_thread_detach != NULL))
+ (p->p_sysent->sv_thread_detach)(td);
+
tidhash_remove(td);
PROC_LOCK(p);
tdsigcleanup(td);
Index: sys/sys/sysent.h
===================================================================
--- sys/sys/sysent.h
+++ sys/sys/sysent.h
@@ -136,6 +136,7 @@
uint32_t sv_timekeep_gen;
void *sv_shared_page_obj;
void (*sv_schedtail)(struct thread *);
+ void (*sv_thread_detach)(struct thread *);
};
#define SV_ILP32 0x000100
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 2:40 PM (19 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31037591
Default Alt Text
D1038.id2168.diff (1 KB)
Attached To
Mode
D1038: In preparation for switching linuxulator to the use the native 1:1 threads add hook for cleaning thread resources before the thread die.
Attached
Detach File
Event Timeline
Log In to Comment