Make sure the thread constructor and destructor eventhandlers are
authorhselasky <hselasky@FreeBSD.org>
Sun, 19 Feb 2017 13:15:33 +0000 (13:15 +0000)
committerhselasky <hselasky@FreeBSD.org>
Sun, 19 Feb 2017 13:15:33 +0000 (13:15 +0000)
commitcd642379ab4709c404bc6599035cf9c1176cdefd
tree7d8141cd02e2058b72f008a48ec7803392afdec2
parentca1a1a9d60fc7133fed31bb48241296ad502531f
Make sure the thread constructor and destructor eventhandlers are
called for all threads belonging to a procedure. Currently the first
thread in a procedure is kept around as an optimisation step and is
never freed. Because the first thread in a procedure is never freed
nor allocated, its destructor and constructor callbacks are never
called which means per thread structures allocated by dtrace and the
Linux emulation layers for example, might be present for threads which
don't need these structures.

This patch adds a thread construction and destruction call for the
first thread in a procedure.

Tested: dtrace, linux emulation
Reviewed by: kib @
MFC after: 1 week
Sponsored by: Mellanox Technologies
sys/kern/kern_proc.c