[WIP] Threading phase 2 (#301)

* Exponential back-off
* Removed "native" specifier
* Abstract away Futex for cthread
* Complete setup for TLS (including main thread)
This commit is contained in:
Florian Lemaitre 2021-10-26 01:02:26 +02:00 committed by GitHub
parent 660ff56d40
commit 45a7435788
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 249 additions and 78 deletions

16
libc/thread/wait.h Normal file
View file

@ -0,0 +1,16 @@
#ifndef COSMOPOLITAN_LIBC_THREAD_WAIT_H_
#define COSMOPOLITAN_LIBC_THREAD_WAIT_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
/**
* @fileoverview wait on memory
*/
struct timespec;
int cthread_memory_wait32(uint32_t*, uint32_t, const struct timespec*);
int cthread_memory_wake32(uint32_t*, int);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_THREAD_WAIT_H_ */