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:
Justine Tunney 2023-07-06 06:57:28 -07:00
parent 88612a2cd7
commit 0a24b4fc3c
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
268 changed files with 632 additions and 8688 deletions

View file

@ -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