| 634 | } |
| 635 | |
| 636 | bool counter_t::decrease() |
| 637 | { |
| 638 | SKR_ASSERT(state->count > 0); |
| 639 | auto count = --state->count; |
| 640 | if(state->inverse) |
| 641 | return false; |
| 642 | if(count == 0) |
| 643 | { |
| 644 | SMutexLock guard(state->mutex); |
| 645 | state->cv.notify(); |
| 646 | return true; |
| 647 | } |
| 648 | return false; |
| 649 | } |
| 650 | |
| 651 | void scheduler_t::initialize(const scheudler_config_t & cfg) |
| 652 | { |