CBL-Mariner/SPECS/glibc/glibc-2.34_pthread_cond_wai...

20 строки
824 B
Diff

diff -ruN a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
--- a/nptl/pthread_cond_wait.c 2021-11-05 15:04:17.337600296 -0700
+++ b/nptl/pthread_cond_wait.c 2021-11-05 15:05:23.813388264 -0700
@@ -589,6 +589,15 @@
the signal from, which cause it to block using the
futex). */
futex_wake (cond->__data.__g_signals + g, 1, private);
+
+ /* We might be wrong about stealing, we got the signal
+ from the an old g1, but ended up returning it to
+ a different g1. We can't tell whether it is the case.
+ If it is, we now caused another issue:
+ now g_refs[g1] is one less than g_size[g1].
+ The mitigation step is to broadcast g1 and g2, let every
+ waiter wake up spuriosly. */
+ __pthread_cond_broadcast(cond);
break;
}
/* TODO Back off. */