| 84 | Array<Function<void()>> List; |
| 85 | |
| 86 | void Add(const Function<void()>& func, bool wait) |
| 87 | { |
| 88 | Locker.Lock(); |
| 89 | List.Add(func); |
| 90 | Locker.Unlock(); |
| 91 | |
| 92 | // TODO: use atomic counters for more optimized waiting |
| 93 | while (wait) |
| 94 | { |
| 95 | Platform::Sleep(1); |
| 96 | Locker.Lock(); |
| 97 | wait = List.HasItems(); |
| 98 | Locker.Unlock(); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | void Run() |
| 103 | { |
no test coverage detected