mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +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
|
@ -93,7 +93,7 @@ ssize_t recvmsg(int fd, struct msghdr *msg, int flags) {
|
|||
}
|
||||
|
||||
#if defined(SYSDEBUG) && _DATATRACE
|
||||
if (__strace > 0) {
|
||||
if (__strace > 0 && strace_enabled(0) > 0) {
|
||||
if (!msg || (rc == -1 && errno == EFAULT)) {
|
||||
DATATRACE("recvmsg(%d, %p, %#x) → %'ld% m", fd, msg, flags, rc);
|
||||
} else {
|
||||
|
|
|
@ -80,7 +80,7 @@ ssize_t sendmsg(int fd, const struct msghdr *msg, int flags) {
|
|||
}
|
||||
|
||||
#if defined(SYSDEBUG) && _DATATRACE
|
||||
if (__strace > 0) {
|
||||
if (__strace > 0 && strace_enabled(0) > 0) {
|
||||
kprintf(STRACE_PROLOGUE "sendmsg(");
|
||||
if ((!IsAsan() && kisdangerous(msg)) ||
|
||||
(IsAsan() && !__asan_is_valid(msg, sizeof(*msg)))) {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define COSMOPOLITAN_LIBC_SOCK_STRUCT_POLLFD_INTERNAL_H_
|
||||
#include "libc/calls/struct/sigset.h"
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/mem/alloca.h"
|
||||
#include "libc/sock/struct/pollfd.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
@ -12,6 +13,9 @@ int sys_ppoll(struct pollfd *, size_t, const struct timespec *,
|
|||
int sys_poll_metal(struct pollfd *, size_t, unsigned);
|
||||
int sys_poll_nt(struct pollfd *, uint64_t, uint64_t *, const sigset_t *) hidden;
|
||||
|
||||
const char *DescribePollFds(char[300], ssize_t, struct pollfd *, size_t);
|
||||
#define DescribePollFds(x, y, z) DescribePollFds(alloca(300), x, y, z)
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_STRUCT_POLLFD_INTERNAL_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue