git: DragonFly_RELEASE_4_6 kernel - Be nicer to pthreads in vfork()
Matthew Dillon
dillon at crater.dragonflybsd.org
Thu Jul 28 18:27:13 PDT 2016
commit de4095f1f94fa072173dba0414f4338348149473
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Thu Jul 28 10:12:39 2016 -0700
kernel - Be nicer to pthreads in vfork()
* When vfork()ing, give the new sub-process's lwp the same TID as the one
that called vfork(). Even though user processes are not supposed to do
anything sophisticated inside a vfork() prior to exec()ing, some things
such as fileno() having to lock in a threaded environment might not be
apparent to the programmer.
* By giving the sub-process the same TID, operations done inside the
vfork() prior to exec that interact with pthreads will not confuse
pthreads and cause corruption due to e.g. TID 0 clashing with TID 0
running in the parent that is running concurrently.
Summary of changes:
sys/kern/kern_fork.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/de4095f1f94fa072173dba0414f4338348149473
--
DragonFly BSD source repository
More information about the Commits
mailing list