Fix package.sh build error

This commit is contained in:
Justine Tunney 2024-07-26 06:57:24 -07:00
parent 642e9cb91a
commit efb3a34608
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3 changed files with 12 additions and 18 deletions

View file

@ -40,8 +40,12 @@ static int malloc_wipe(MLOCK_T *lk) {
static int malloc_lock(MLOCK_T *lk) {
if (!__threaded) return 0;
while (atomic_exchange_explicit(lk, 1, memory_order_acquire)) {
pthread_pause_np();
for (;;) {
if (!atomic_exchange_explicit(lk, 1, memory_order_acquire))
break;
for (;;)
if (!atomic_load_explicit(lk, memory_order_relaxed))
break;
}
return 0;
}