================
@@ -16,7 +17,10 @@ function_to_call() {
 void *
 suspend_func (void *unused) {
   pthread_setname_np("Look for me");
+  pthread_mutex_lock(&signal_mutex);
+  g_signaled = 1;
   pthread_cond_signal(&signal_cond);
+  pthread_mutex_unlock(&signal_mutex);
----------------
qiyao wrote:

`pthread_cond_wait` unlocks mutex on entry and locks mutex on exit.  The mutex 
unlock above is needed so `pthread_cond_wait`  can acquire the mutex and 
return.  This is how to guarantee the happen-before relationship.

https://github.com/llvm/llvm-project/pull/203202
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to