File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -553,6 +553,7 @@ static inline void mi_lock_done(mi_lock_t* lock) {
553553
554554// fall back to poor man's locks.
555555// this should only be the case in a single-threaded environment (like __wasi__)
556+ void _mi_error_message (int err, const char * fmt, ...);
556557
557558typedef union mi_lock_u {
558559 size_t _init; // for static initialization
@@ -564,10 +565,11 @@ static inline bool mi_lock_try_acquire(mi_lock_t* lock) {
564565 return mi_atomic_cas_strong_acq_rel (&lock->mutex , &expected, (uintptr_t )1 );
565566}
566567static inline void mi_lock_acquire (mi_lock_t * lock) {
567- for (int i = 0 ; i < 1000 ; i++) { // for at most 1000 tries?
568+ for (int i = 0 ; i < 10000 ; i++) { // for at most 10000 tries?
568569 if (mi_lock_try_acquire (lock)) return ;
569570 mi_atomic_yield ();
570571 }
572+ _mi_error_message (EFAULT, " internal error: lock cannot be acquired (due to lack of native lock primitives)\n " );
571573}
572574static inline void mi_lock_release (mi_lock_t * lock) {
573575 mi_atomic_store_release (&lock->mutex , (uintptr_t )0 );
You can’t perform that action at this time.
0 commit comments