Browse Source

Merge pull request #2962 from FragmentedCurve/issue_2601

Return value of _umtx_op on FreeBSD wasn't checked correctly
gingerBill 1 year ago
parent
commit
37e79f9cca
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/threading.cpp

+ 1 - 1
src/threading.cpp

@@ -660,7 +660,7 @@ gb_internal void futex_broadcast(Futex *addr) {
 gb_internal void futex_wait(Futex *addr, Footex val) {
 gb_internal void futex_wait(Futex *addr, Footex val) {
 	for (;;) {
 	for (;;) {
 		int ret = _umtx_op(addr, UMTX_OP_WAIT_UINT, val, 0, NULL);
 		int ret = _umtx_op(addr, UMTX_OP_WAIT_UINT, val, 0, NULL);
-		if (ret == 0) {
+		if (ret == -1) {
 			if (errno == ETIMEDOUT || errno == EINTR) {
 			if (errno == ETIMEDOUT || errno == EINTR) {
 				continue;
 				continue;
 			}
 			}