summaryrefslogtreecommitdiffstats
path: root/share/examples/etc
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-02-25 19:10:51 +0000
committerrwatson <rwatson@FreeBSD.org>2005-02-25 19:10:51 +0000
commitcf6830b6a7a1495a33601199cd6ea3916cb92317 (patch)
tree57247e63ca88e3fb8c2e52d84210be9ef404a7b8 /share/examples/etc
parent371673aec831d8335f177b4cc155e42394ab140a (diff)
downloadFreeBSD-src-cf6830b6a7a1495a33601199cd6ea3916cb92317.zip
FreeBSD-src-cf6830b6a7a1495a33601199cd6ea3916cb92317.tar.gz
Add an exit hook, sem_forkhook(), which walks the list of POSIX semaphores
owned by a process when it forks, and creates a matching set of references for the child process, as prescribed by POSIX. In order to avoid races with other threads in the parent process during fork(), it is necessary to allocate a temporary reference list while holding the sem_lock, then transfer those references to the new process once the sem_lock is released. The implementation is inefficient but appears functional; in order to improve the efficiency, it will be necessary to modify the existing structures and logic, which generally rely on O(n) operations over the global set of semaphores.
Diffstat (limited to 'share/examples/etc')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud