mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-20 09:30:31 +00:00
Clean up more code
The *NSYNC linked list API is good enough that it deserves to be part of the C libray, so this change writes an improved version of it which uses that offsetof() trick from the Linux Kernel. We vendor all of the *NSYNC tests in third_party which helped confirm the needed refactoring is safe This change also deletes more old code that didn't pan out. My goal here is to work towards a vision where the Cosmopolitan core libraries become less experimental and more focused on curation. This better reflects the current level of quality we've managed to achieve.
This commit is contained in:
parent
88612a2cd7
commit
0a24b4fc3c
268 changed files with 632 additions and 8688 deletions
4
third_party/nsync/wait_s.internal.h
vendored
4
third_party/nsync/wait_s.internal.h
vendored
|
@ -1,7 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_THREAD_WAIT_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_THREAD_WAIT_INTERNAL_H_
|
||||
#include "libc/intrin/dll.h"
|
||||
#include "third_party/nsync/atomic.h"
|
||||
#include "third_party/nsync/dll.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
@ -13,7 +13,7 @@ COSMOPOLITAN_C_START_
|
|||
struct nsync_waiter_s {
|
||||
uint32_t tag; /* used for debugging */
|
||||
uint32_t flags; /* see below */
|
||||
nsync_dll_element_ q; /* used to link children of parent */
|
||||
struct Dll q; /* used to link children of parent */
|
||||
nsync_atomic_uint32_ waiting; /* non-zero <=> the waiter is waiting */
|
||||
struct nsync_semaphore_s_ *sem; /* *sem will be Ved when waiter is woken */
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue