Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_thread.c
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/umtxvar.h> | #include <sys/umtxvar.h> | ||||
#include <sys/vmmeter.h> | #include <sys/vmmeter.h> | ||||
#include <sys/cpuset.h> | #include <sys/cpuset.h> | ||||
#ifdef HWPMC_HOOKS | #ifdef HWPMC_HOOKS | ||||
#include <sys/pmckern.h> | #include <sys/pmckern.h> | ||||
#endif | #endif | ||||
#include <sys/priv.h> | #include <sys/priv.h> | ||||
#include <sys/aio.h> | |||||
#include <security/audit/audit.h> | #include <security/audit/audit.h> | ||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_extern.h> | #include <vm/vm_extern.h> | ||||
#include <vm/uma.h> | #include <vm/uma.h> | ||||
#include <vm/vm_phys.h> | #include <vm/vm_phys.h> | ||||
▲ Show 20 Lines • Show All 285 Lines • ▼ Show 20 Lines | |||||
#ifdef AUDIT | #ifdef AUDIT | ||||
audit_thread_alloc(td); | audit_thread_alloc(td); | ||||
#endif | #endif | ||||
#ifdef KDTRACE_HOOKS | #ifdef KDTRACE_HOOKS | ||||
kdtrace_thread_ctor(td); | kdtrace_thread_ctor(td); | ||||
#endif | #endif | ||||
umtx_thread_alloc(td); | umtx_thread_alloc(td); | ||||
MPASS(td->td_sel == NULL); | MPASS(td->td_sel == NULL); | ||||
atomic_store_int(&td->td_aio_count, 0); | |||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Reclaim a thread after use. | * Reclaim a thread after use. | ||||
*/ | */ | ||||
static void | static void | ||||
thread_dtor(void *mem, int size, void *arg) | thread_dtor(void *mem, int size, void *arg) | ||||
Show All 25 Lines | |||||
#ifdef AUDIT | #ifdef AUDIT | ||||
audit_thread_free(td); | audit_thread_free(td); | ||||
#endif | #endif | ||||
#ifdef KDTRACE_HOOKS | #ifdef KDTRACE_HOOKS | ||||
kdtrace_thread_dtor(td); | kdtrace_thread_dtor(td); | ||||
#endif | #endif | ||||
/* Free all OSD associated to this thread. */ | /* Free all OSD associated to this thread. */ | ||||
osd_thread_exit(td); | osd_thread_exit(td); | ||||
aio_thread_exit(td); | |||||
td_softdep_cleanup(td); | td_softdep_cleanup(td); | ||||
MPASS(td->td_su == NULL); | MPASS(td->td_su == NULL); | ||||
seltdfini(td); | seltdfini(td); | ||||
} | } | ||||
/* | /* | ||||
* Initialize type-stable parts of a thread (when newly created). | * Initialize type-stable parts of a thread (when newly created). | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,352 Lines • Show Last 20 Lines |