MCPcopy Create free account
hub / github.com/Singular/Singular / try_wait

Method try_wait

kernel/oswrapper/vspace.cc:474–483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474bool Semaphore::try_wait() {
475 bool result = false;
476 _lock.lock();
477 if (_value > 0) {
478 _value--;
479 result = true;
480 }
481 _lock.unlock();
482 return result;
483}
484
485void Semaphore::wait() {
486 _lock.lock();

Callers 2

try_enqueueMethod · 0.80
try_dequeueMethod · 0.80

Calls 2

lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected