mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-25 14:52:28 +00:00
Reduce header complexity
- Remove most __ASSEMBLER__ __LINKER__ ifdefs - Rename libc/intrin/bits.h to libc/serialize.h - Block pthread cancelation in fchmodat() polyfill - Remove `clang-format off` statements in third_party
This commit is contained in:
parent
96f979dfc5
commit
fa20edc44d
3057 changed files with 410 additions and 4398 deletions
1
third_party/nsync/testing/atm_log.c
vendored
1
third_party/nsync/testing/atm_log.c
vendored
|
@ -18,7 +18,6 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/thread/thread.h"
|
||||
// clang-format off
|
||||
|
||||
#ifndef NSYNC_ATM_LOG
|
||||
#define NSYNC_ATM_LOG 0
|
||||
|
|
1
third_party/nsync/testing/closure.c
vendored
1
third_party/nsync/testing/closure.c
vendored
|
@ -16,7 +16,6 @@
|
|||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "third_party/nsync/testing/closure.h"
|
||||
// clang-format off
|
||||
|
||||
void nsync_start_thread_ (void (*f) (void *), void *arg);
|
||||
|
||||
|
|
1
third_party/nsync/testing/closure.h
vendored
1
third_party/nsync/testing/closure.h
vendored
|
@ -1,6 +1,5 @@
|
|||
#ifndef NSYNC_TESTING_CLOSURE_H_
|
||||
#define NSYNC_TESTING_CLOSURE_H_
|
||||
/* clang-format off */
|
||||
#include "libc/mem/mem.h"
|
||||
|
||||
/* A run-once, self-freeing closure. */
|
||||
|
|
1
third_party/nsync/testing/counter_test.c
vendored
1
third_party/nsync/testing/counter_test.c
vendored
|
@ -20,7 +20,6 @@
|
|||
#include "third_party/nsync/testing/smprintf.h"
|
||||
#include "third_party/nsync/testing/testing.h"
|
||||
#include "third_party/nsync/testing/time_extra.h"
|
||||
// clang-format off
|
||||
|
||||
/* Verify the properties of a zero counter. */
|
||||
static void test_counter_zero (testing t) {
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "third_party/nsync/testing/closure.h"
|
||||
#include "third_party/nsync/testing/smprintf.h"
|
||||
#include "third_party/nsync/testing/testing.h"
|
||||
// clang-format off
|
||||
|
||||
/* A cv_stress_data represents the data used by the threads of the tests below. */
|
||||
typedef struct cv_stress_data_s {
|
||||
|
|
1
third_party/nsync/testing/cv_test.c
vendored
1
third_party/nsync/testing/cv_test.c
vendored
|
@ -30,7 +30,6 @@
|
|||
#include "third_party/nsync/testing/testing.h"
|
||||
#include "third_party/nsync/testing/time_extra.h"
|
||||
#include "third_party/nsync/time.h"
|
||||
// clang-format off
|
||||
|
||||
/* --------------------------- */
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "third_party/nsync/testing/smprintf.h"
|
||||
#include "third_party/nsync/testing/testing.h"
|
||||
#include "third_party/nsync/testing/time_extra.h"
|
||||
// clang-format off
|
||||
|
||||
/* Example use of CV.wait(): A priority queue of strings whose
|
||||
"remove_with_deadline" operation has a deadline. */
|
||||
|
|
1
third_party/nsync/testing/dll_test.c
vendored
1
third_party/nsync/testing/dll_test.c
vendored
|
@ -22,7 +22,6 @@
|
|||
#include "third_party/nsync/array.internal.h"
|
||||
#include "third_party/nsync/testing/smprintf.h"
|
||||
#include "third_party/nsync/testing/testing.h"
|
||||
// clang-format off
|
||||
|
||||
/* This tests internal abstractions. */
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "third_party/nsync/testing/testing.h"
|
||||
#include "third_party/nsync/testing/time_extra.h"
|
||||
#include "third_party/nsync/time.h"
|
||||
// clang-format off
|
||||
|
||||
/* Test the behaviour of mu in situations where starvation might be expected. */
|
||||
|
||||
|
|
1
third_party/nsync/testing/mu_test.c
vendored
1
third_party/nsync/testing/mu_test.c
vendored
|
@ -25,7 +25,6 @@
|
|||
#include "third_party/nsync/testing/smprintf.h"
|
||||
#include "third_party/nsync/testing/testing.h"
|
||||
#include "third_party/nsync/testing/time_extra.h"
|
||||
// clang-format off
|
||||
|
||||
/* The state shared between the threads in each of the tests below. */
|
||||
typedef struct test_data_s {
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "third_party/nsync/testing/smprintf.h"
|
||||
#include "third_party/nsync/testing/testing.h"
|
||||
#include "third_party/nsync/testing/time_extra.h"
|
||||
// clang-format off
|
||||
|
||||
/* Example use of nsync_mu_wait(): A priority queue of strings whose
|
||||
"remove_with_deadline" operation has a deadline. */
|
||||
|
|
1
third_party/nsync/testing/mu_wait_test.c
vendored
1
third_party/nsync/testing/mu_wait_test.c
vendored
|
@ -25,7 +25,6 @@
|
|||
#include "third_party/nsync/testing/testing.h"
|
||||
#include "third_party/nsync/testing/time_extra.h"
|
||||
#include "third_party/nsync/time.h"
|
||||
// clang-format off
|
||||
|
||||
/* --------------------------- */
|
||||
|
||||
|
|
1
third_party/nsync/testing/note_test.c
vendored
1
third_party/nsync/testing/note_test.c
vendored
|
@ -21,7 +21,6 @@
|
|||
#include "third_party/nsync/testing/testing.h"
|
||||
#include "third_party/nsync/testing/time_extra.h"
|
||||
#include "third_party/nsync/time.h"
|
||||
// clang-format off
|
||||
|
||||
/* Verify the properties of a prenotified note. */
|
||||
static void test_note_prenotified (testing t) {
|
||||
|
|
1
third_party/nsync/testing/once_test.c
vendored
1
third_party/nsync/testing/once_test.c
vendored
|
@ -23,7 +23,6 @@
|
|||
#include "third_party/nsync/testing/closure.h"
|
||||
#include "third_party/nsync/testing/smprintf.h"
|
||||
#include "third_party/nsync/testing/testing.h"
|
||||
// clang-format off
|
||||
|
||||
/* This tests nsync_once */
|
||||
|
||||
|
|
1
third_party/nsync/testing/pingpong_test.c
vendored
1
third_party/nsync/testing/pingpong_test.c
vendored
|
@ -27,7 +27,6 @@
|
|||
#include "third_party/nsync/testing/smprintf.h"
|
||||
#include "third_party/nsync/testing/testing.h"
|
||||
#include "third_party/nsync/waiter.h"
|
||||
// clang-format off
|
||||
|
||||
/* The benchmarks in this file use various mechanisms to
|
||||
ping-pong back and forth between two threads as they count i from
|
||||
|
|
1
third_party/nsync/testing/smprintf.c
vendored
1
third_party/nsync/testing/smprintf.c
vendored
|
@ -19,7 +19,6 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
// clang-format off
|
||||
|
||||
char *smprintf (const char *fmt, ...) {
|
||||
int m = strlen (fmt) * 2 + 1;
|
||||
|
|
1
third_party/nsync/testing/start_thread.c
vendored
1
third_party/nsync/testing/start_thread.c
vendored
|
@ -17,7 +17,6 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/thread/thread.h"
|
||||
// clang-format off
|
||||
|
||||
struct thd_args {
|
||||
void (*f) (void *);
|
||||
|
|
1
third_party/nsync/testing/testing.c
vendored
1
third_party/nsync/testing/testing.c
vendored
|
@ -33,7 +33,6 @@
|
|||
#include "third_party/nsync/testing/closure.h"
|
||||
#include "third_party/nsync/testing/smprintf.h"
|
||||
#include "third_party/nsync/testing/time_extra.h"
|
||||
// clang-format off
|
||||
|
||||
struct testing_base_s {
|
||||
int flags; /* flags from testing_new(); r/o after init */
|
||||
|
|
1
third_party/nsync/testing/testing.h
vendored
1
third_party/nsync/testing/testing.h
vendored
|
@ -1,6 +1,5 @@
|
|||
#ifndef NSYNC_TESTING_TESTING_H_
|
||||
#define NSYNC_TESTING_TESTING_H_
|
||||
/* clang-format off */
|
||||
|
||||
typedef struct testing_base_s *testing_base;
|
||||
typedef const struct testing_base_s *const_testing_base;
|
||||
|
|
1
third_party/nsync/testing/time_extra.c
vendored
1
third_party/nsync/testing/time_extra.c
vendored
|
@ -20,7 +20,6 @@
|
|||
#include "third_party/nsync/testing/smprintf.h"
|
||||
#include "third_party/nsync/testing/time_extra.h"
|
||||
#include "third_party/nsync/time.h"
|
||||
// clang-format off
|
||||
|
||||
char *nsync_time_str (nsync_time t, int decimals) {
|
||||
static const struct {
|
||||
|
|
1
third_party/nsync/testing/wait_test.c
vendored
1
third_party/nsync/testing/wait_test.c
vendored
|
@ -25,7 +25,6 @@
|
|||
#include "third_party/nsync/testing/time_extra.h"
|
||||
#include "third_party/nsync/time.h"
|
||||
#include "third_party/nsync/waiter.h"
|
||||
// clang-format off
|
||||
|
||||
static void decrement_at (nsync_counter c, nsync_time abs_deadline, nsync_counter done) {
|
||||
nsync_time_sleep_until (abs_deadline);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue