| 17 | } |
| 18 | |
| 19 | void ThreadGuard::CheckThread(const std::source_location& loc) const { |
| 20 | #ifdef DEBUG |
| 21 | const auto thisThread = GetCurrentThreadId(); |
| 22 | if (thisThread == mThreadID) { |
| 23 | return; |
| 24 | } |
| 25 | dprint( |
| 26 | "ThreadGuard mismatch: was {} ({:#x}), now {} ({:#x})", |
| 27 | mThreadID, |
| 28 | mThreadID, |
| 29 | thisThread, |
| 30 | thisThread); |
| 31 | dprint("Created at {}", mLocation); |
| 32 | dprint("Checking at {}", loc); |
| 33 | OPENKNEEBOARD_BREAK; |
| 34 | #endif |
| 35 | } |
| 36 | |
| 37 | ThreadGuard::~ThreadGuard() { |
| 38 | this->CheckThread(); |
no outgoing calls
no test coverage detected