mirror of
https://abf.rosa.ru/djam/glibc40.git
synced 2025-02-23 15:52:52 +00:00
17 lines
467 B
Diff
17 lines
467 B
Diff
--- glibc-2.27/nptl/pthread_mutex_lock.c~ 2018-02-01 16:17:18.000000000 +0000
|
|
+++ glibc-2.27/nptl/pthread_mutex_lock.c 2018-05-15 14:19:00.864190585 +0000
|
|
@@ -133,7 +133,13 @@
|
|
LLL_MUTEX_LOCK (mutex);
|
|
break;
|
|
}
|
|
- atomic_spin_nop ();
|
|
+ /* MO read while spinning */
|
|
+ do
|
|
+ {
|
|
+ atomic_spin_nop ();
|
|
+ }
|
|
+ while (atomic_load_relaxed (&mutex->__data.__lock) != 0 &&
|
|
+ ++cnt < max_cnt);
|
|
}
|
|
while (LLL_MUTEX_TRYLOCK (mutex) != 0);
|
|
|