mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 06:53:33 +00:00
b40140e6c5
In the course of playing with redbean I was confused about how the state was behaving and then noticed that some stuff is maybe getting edited by multiple processes. I tried to improve things by changing the definition of the counter variables to be explicitly atomic. Claude assures me that most modern Unixes support cross-process atomics, so I just went with it on that front. I also added some mutexes to the shared state to try to synchronize some other things that might get written or read from workers but couldn't be made atomic, mainly the rusage and time values. I could've probably been less granular and just had a global shared-state lock, but I opted to be fairly granular as a starting point. This also reorders the resetting of the lastmeltdown timespec before the SIGUSR2 signal is sent; hopefully this is okay. |
||
---|---|---|
.. | ||
demo | ||
tiny | ||
.init.lua | ||
BUILD.mk | ||
counters.inc | ||
definitions.lua | ||
dig.c | ||
echo.c | ||
favicon.ico | ||
fetch.inc | ||
getadaptersaddresses.c | ||
help.txt | ||
largon2.c | ||
launch.c | ||
lfinger.c | ||
lfinger.h | ||
lfuncs.c | ||
lfuncs.h | ||
libresolv_query.c | ||
ljson.c | ||
ljson.h | ||
lmaxmind.c | ||
lpath.c | ||
lpath.h | ||
lre.c | ||
lsqlite3.c | ||
luacheck.h | ||
redbean-original.c | ||
redbean-static.c | ||
redbean-unsecure.c | ||
redbean.c | ||
redbean.png | ||
sandbox.h | ||
winbench.c |