ditch semaphores in thread pool in favor of barriers

This commit is contained in:
Nikita Smith authored and Ryan Fleury committed 2026-06-19 20:12:26 -07:00
1 parent 6ea9bfc5a3
commit 9b63131f37
5 files changed
+44 -58

No files matched your search

+8 -6
View File
@@ -697,13 +697,15 @@ semaphore_take(Semaphore semaphore, U64 endt_us)
}
internal void
semaphore_drop(Semaphore semaphore)
semaphore_drop_count(Semaphore semaphore, U64 count)
{
int err = -1;
if(semaphore.u64[0] != 0)
{
err = LNX_RETRY_ON_EINTR(sem_post((sem_t*)semaphore.u64[0]));
Assert(err == 0);
for EachIndex(i, count) {
int err = -1;
if(semaphore.u64[0] != 0)
{
err = LNX_RETRY_ON_EINTR(sem_post((sem_t*)*semaphore.u64));
Assert(err == 0);
}
}
}