mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
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:
parent
d7b88734cd
commit
e522aa3a07
189 changed files with 1363 additions and 1217 deletions
|
@ -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()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue