mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +00:00
Make more fixes and improvements
- Fix Makefile flaking due to ZIPOBJ_FLAGS generation - Make printf() floating point and gdtoa thread safe - Polish up the runit / runitd programs some more - Prune some more makefile dependencies
This commit is contained in:
parent
3c285337a2
commit
a3865ecc3c
61 changed files with 316 additions and 132 deletions
|
@ -56,7 +56,7 @@ int cthread_join(cthread_t td, void **exitcode) {
|
|||
if (~atomic_fetch_add(&td->state, cthread_joining) & cthread_finished) {
|
||||
while ((x = atomic_load(&td->tid))) {
|
||||
// FUTEX_WAIT_PRIVATE makes it hang
|
||||
cthread_memory_wait32((uint32_t *)&td->tid, x, 0);
|
||||
cthread_memory_wait32(&td->tid, x, 0);
|
||||
}
|
||||
}
|
||||
if (exitcode) {
|
||||
|
|
|
@ -70,8 +70,8 @@ int cthread_sem_init(cthread_sem_t *, int);
|
|||
int cthread_sem_destroy(cthread_sem_t *);
|
||||
int cthread_sem_wait(cthread_sem_t *, int, const struct timespec *);
|
||||
int cthread_sem_signal(cthread_sem_t *);
|
||||
int cthread_memory_wait32(uint32_t *, uint32_t, const struct timespec *);
|
||||
int cthread_memory_wake32(uint32_t *, int);
|
||||
int cthread_memory_wait32(int *, int, const struct timespec *);
|
||||
int cthread_memory_wake32(int *, int);
|
||||
void cthread_zombies_add(cthread_t);
|
||||
void cthread_zombies_reap(void);
|
||||
|
||||
|
|
|
@ -24,12 +24,11 @@
|
|||
#include "libc/thread/freebsd.internal.h"
|
||||
#include "libc/thread/thread.h"
|
||||
|
||||
int cthread_memory_wait32(uint32_t* addr, uint32_t val,
|
||||
const struct timespec* timeout) {
|
||||
int cthread_memory_wait32(int* addr, int val, const struct timespec* timeout) {
|
||||
size_t size;
|
||||
struct _umtx_time *put, ut;
|
||||
if (IsLinux() || IsOpenbsd()) {
|
||||
return futex(addr, FUTEX_WAIT, val, timeout, 0);
|
||||
return sys_futex(addr, FUTEX_WAIT, val, timeout, 0);
|
||||
|
||||
#if 0
|
||||
} else if (IsFreebsd()) {
|
||||
|
@ -59,9 +58,9 @@ int cthread_memory_wait32(uint32_t* addr, uint32_t val,
|
|||
}
|
||||
}
|
||||
|
||||
int cthread_memory_wake32(uint32_t* addr, int n) {
|
||||
int cthread_memory_wake32(int* addr, int n) {
|
||||
if (IsLinux() || IsOpenbsd()) {
|
||||
return futex(addr, FUTEX_WAKE, n, 0, 0);
|
||||
return sys_futex(addr, FUTEX_WAKE, n, 0, 0);
|
||||
#if 0
|
||||
} else if (IsFreebsd()) {
|
||||
return _umtx_op(addr, UMTX_OP_MUTEX_WAKE, n, 0, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue