| 153 | } |
| 154 | |
| 155 | bool Thread::block() { |
| 156 | tproc->ops->block(this); |
| 157 | |
| 158 | std::uint32_t prev = interruptedMtx.exchange(0, std::memory_order::relaxed); |
| 159 | if (prev != 0) { |
| 160 | interruptedMtx.notify_one(); |
| 161 | } |
| 162 | |
| 163 | return prev == 0; |
| 164 | } |
| 165 | |
| 166 | scoped_unblock::scoped_unblock() { |
| 167 | if (g_currentThread && g_currentThread->context) { |
no test coverage detected