| 338 | } |
| 339 | |
| 340 | void EnsureInited() |
| 341 | { |
| 342 | // Check current state |
| 343 | Locker.Lock(); |
| 344 | bool inited = Inited; |
| 345 | Locker.Unlock(); |
| 346 | if (inited) |
| 347 | return; |
| 348 | |
| 349 | // Wait for any async task |
| 350 | if (AsyncTask) |
| 351 | AsyncTask->Wait(); |
| 352 | |
| 353 | // Do sync init if still not inited |
| 354 | Locker.Lock(); |
| 355 | if (!Inited) |
| 356 | InitCommands(); |
| 357 | Locker.Unlock(); |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | class DebugCommandsService : public EngineService |
no test coverage detected