| 56 | } |
| 57 | |
| 58 | SystemEventSubscription subscribeSystemEvent(SystemEvent event, OnSystemEvent handler) { |
| 59 | if (mutex.lock(MAX_TICKS)) { |
| 60 | auto id = ++subscriptionCounter; |
| 61 | |
| 62 | subscriptions.push_back({ |
| 63 | .id = id, |
| 64 | .event = event, |
| 65 | .handler = handler |
| 66 | }); |
| 67 | |
| 68 | mutex.unlock(); |
| 69 | return id; |
| 70 | } else { |
| 71 | check(false); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | void unsubscribeSystemEvent(SystemEventSubscription subscription) { |
| 76 | if (mutex.lock(MAX_TICKS)) { |
no test coverage detected