瀏覽代碼

`if` -> `while` in `wait_signal_until_available` to check for spurious wake-ups

gingerBill 1 年之前
父節點
當前提交
d7b7804215
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/threading.cpp

+ 1 - 1
src/threading.cpp

@@ -112,7 +112,7 @@ struct Wait_Signal {
 };
 
 gb_internal void wait_signal_until_available(Wait_Signal *ws) {
-	if (ws->futex.load() == 0) {
+	while (ws->futex.load() == 0) {
 		futex_wait(&ws->futex, 1);
 	}
 }