mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-04 11:42:28 +00:00
Remove __threaded variable
This commit is contained in:
parent
01b09bc817
commit
cf1559c448
15 changed files with 51 additions and 71 deletions
4
third_party/dlmalloc/locks.inc
vendored
4
third_party/dlmalloc/locks.inc
vendored
|
@ -39,7 +39,6 @@ static int malloc_wipe(MLOCK_T *lk) {
|
|||
}
|
||||
|
||||
static int malloc_lock(MLOCK_T *lk) {
|
||||
if (!__threaded) return 0;
|
||||
for (;;) {
|
||||
if (!atomic_exchange_explicit(lk, 1, memory_order_acquire))
|
||||
break;
|
||||
|
@ -51,7 +50,6 @@ static int malloc_lock(MLOCK_T *lk) {
|
|||
}
|
||||
|
||||
static int malloc_unlock(MLOCK_T *lk) {
|
||||
if (!__threaded) return 0;
|
||||
atomic_store_explicit(lk, 0, memory_order_release);
|
||||
return 0;
|
||||
}
|
||||
|
@ -66,13 +64,11 @@ static int malloc_wipe(MLOCK_T *lk) {
|
|||
}
|
||||
|
||||
static int malloc_lock(MLOCK_T *lk) {
|
||||
if (!__threaded) return 0;
|
||||
nsync_mu_lock(lk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int malloc_unlock(MLOCK_T *lk) {
|
||||
if (!__threaded) return 0;
|
||||
nsync_mu_unlock(lk);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue