mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +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/cv.h
vendored
4
third_party/nsync/cv.h
vendored
|
@ -1,5 +1,6 @@
|
|||
#ifndef NSYNC_CV_H_
|
||||
#define NSYNC_CV_H_
|
||||
#include "libc/intrin/dll.h"
|
||||
#include "third_party/nsync/mu.h"
|
||||
#include "third_party/nsync/time.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
@ -8,7 +9,6 @@ COSMOPOLITAN_C_START_
|
|||
#define NSYNC_CV_INIT \
|
||||
{ NSYNC_ATOMIC_UINT32_INIT_, 0 }
|
||||
|
||||
struct nsync_dll_element_s_;
|
||||
struct nsync_note_s_;
|
||||
|
||||
/* An nsync_cv is a condition variable in the style of Mesa, Java,
|
||||
|
@ -92,7 +92,7 @@ typedef struct nsync_cv_s_ {
|
|||
/* see bits below */
|
||||
nsync_atomic_uint32_ word;
|
||||
/* points to tail of list of waiters; under mu. */
|
||||
struct nsync_dll_element_s_ *waiters;
|
||||
struct Dll *waiters;
|
||||
} nsync_cv;
|
||||
|
||||
/* An nsync_cv should be zeroed to initialize, which can be accomplished
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue