| 348 | } |
| 349 | |
| 350 | void Device::waitAndThrow() |
| 351 | { |
| 352 | wait(); |
| 353 | |
| 354 | // If an asynchronous error was stored, throw it now |
| 355 | std::lock_guard<std::mutex> asyncErrorLock(asyncErrorMutex); |
| 356 | if (asyncError.code != Error::None) |
| 357 | { |
| 358 | const Error code = asyncError.code; |
| 359 | const std::string message = std::move(asyncError.message); |
| 360 | asyncError = {}; // clear the error |
| 361 | throw Exception(code, message); |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | void Device::syncAndThrow(SyncMode sync) |
| 366 | { |
no test coverage detected