| 42 | } |
| 43 | |
| 44 | void publishSystemEvent(SystemEvent event) { |
| 45 | LOGGER.info("{}", getEventName(event)); |
| 46 | |
| 47 | if (mutex.lock(MAX_TICKS)) { |
| 48 | for (auto& subscription : subscriptions) { |
| 49 | if (subscription.event == event) { |
| 50 | subscription.handler(event); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | mutex.unlock(); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | SystemEventSubscription subscribeSystemEvent(SystemEvent event, OnSystemEvent handler) { |
| 59 | if (mutex.lock(MAX_TICKS)) { |
no test coverage detected