mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-05 12:34:47 +00:00
Fix futex(8) usage on OpenBSD.
This commit is contained in:
@@ -756,7 +756,7 @@ gb_internal void futex_signal(Futex *f) {
|
|||||||
|
|
||||||
perror("Futex wake");
|
perror("Futex wake");
|
||||||
GB_PANIC("futex wake fail");
|
GB_PANIC("futex wake fail");
|
||||||
} else if (ret == 1) {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -773,7 +773,7 @@ gb_internal void futex_broadcast(Futex *f) {
|
|||||||
|
|
||||||
perror("Futex wake");
|
perror("Futex wake");
|
||||||
GB_PANIC("futex wake fail");
|
GB_PANIC("futex wake fail");
|
||||||
} else if (ret == 1) {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -783,7 +783,7 @@ gb_internal void futex_wait(Futex *f, Footex val) {
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
int ret = futex((volatile uint32_t *)f, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, val, NULL, NULL);
|
int ret = futex((volatile uint32_t *)f, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, val, NULL, NULL);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
if (*f != val) {
|
if (errno == EAGAIN) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user