Page MenuHomeFreeBSD

D1038.id2168.diff
No OneTemporary

D1038.id2168.diff

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

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)

Event Timeline