Make more threading improvements

- ASAN memory morgue is now lockless
- Make C11 atomics header more portable
- Rewrote pthread keys support to be lockless
- Simplify Python's unicode table unpacking code
- Make crash report write(2) closer to being atomic
- Make it possible to strace/ftrace a single thread
- ASAN now checks nul-terminated strings fast and properly
- Windows fork() now restores TLS memory of calling thread
This commit is contained in:
Justine Tunney 2022-11-01 22:36:03 -07:00
parent d7b88734cd
commit e522aa3a07
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
189 changed files with 1363 additions and 1217 deletions

View file

@ -30,7 +30,9 @@
#include "libc/sysv/consts/prot.h"
#include "libc/sysv/consts/sig.h"
#include "libc/testlib/ezbench.h"
#include "libc/testlib/subprocess.h"
#include "libc/testlib/testlib.h"
#include "libc/thread/tls.h"
TEST(fork, testPipes) {
int a, b;
@ -131,6 +133,14 @@ TEST(fork, childToChild) {
sigprocmask(SIG_SETMASK, &oldmask, 0);
}
TEST(fork, preservesTlsMemory) {
int pid;
__get_tls()->tib_errno = 31337;
SPAWN(fork);
ASSERT_EQ(31337, __get_tls()->tib_errno);
EXITS(0);
}
void ForkInSerial(void) {
int pid, ws;
ASSERT_NE(-1, (pid = fork()));