1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 12:27:36 +00:00

LibC+LibPthread: Implement pthread_atfork()

This required a bit of rearchitecture, as pthread_atfork() required a
mutex, and duplicating a mutex impl for it was silly.
As such, this patch moves some standalone bits of pthread into LibC and
uses those to implement atfork().
It should be noted that for programs that don't use atfork(), this
mechanism only costs two atomic loads (as opposed to the normal mutex
lock+unlock) :^)
This commit is contained in:
AnotherTest 2021-02-14 18:34:18 +03:30 committed by Andreas Kling
parent 8e074f8665
commit bb777459a0
6 changed files with 231 additions and 37 deletions

View file

@ -17,6 +17,7 @@ set(LIBC_SOURCES
mntent.cpp
netdb.cpp
poll.cpp
pthread_integration.cpp
pwd.cpp
qsort.cpp
scanf.cpp