| 355 | } |
| 356 | |
| 357 | void ArchMultithreadPosix::cancelThread(ArchThread thread) |
| 358 | { |
| 359 | assert(thread != nullptr); |
| 360 | |
| 361 | // set cancel and wakeup flags if thread can be cancelled |
| 362 | bool wakeup = false; |
| 363 | |
| 364 | { |
| 365 | std::scoped_lock lock{m_threadMutex}; |
| 366 | if (!thread->m_exited && !thread->m_cancelling) { |
| 367 | thread->m_cancel = true; |
| 368 | wakeup = true; |
| 369 | } |
| 370 | } |
| 371 | |
| 372 | // force thread to exit system calls if wakeup is true |
| 373 | if (wakeup) { |
| 374 | pthread_kill(thread->m_thread, SIGWAKEUP); |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | void ArchMultithreadPosix::setPriorityOfThread(ArchThread thread, int /*n*/) |
| 379 | { |
no outgoing calls
no test coverage detected