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

Method stop_wait

kernel/oswrapper/vspace.cc:514–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514bool Semaphore::stop_wait() {
515 bool result = false;
516 _lock.lock();
517 for (int i = _head; i != _tail; next(i)) {
518 if (_waiting[i] == internals::vmem.current_process) {
519 int last = i;
520 next(i);
521 while (i != _tail) {
522 _waiting[last] = _waiting[i];
523 _signals[last] = _signals[i];
524 last = i;
525 next(i);
526 }
527 _tail = last;
528 result = true;
529 break;
530 }
531 }
532 _lock.unlock();
533 return result;
534}
535
536void EventSet::add(Event *event) {
537 event->_next = NULL;

Callers

nothing calls this directly

Calls 3

nextFunction · 0.85
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected