mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-16 19:20:13 -08:00
ditch semaphores in thread pool in favor of barriers
This commit is contained in:
1 parent
6ea9bfc5a3
commit
9b63131f37
5 files changed
+44
-58
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user