MCPcopy Create free account
hub / github.com/deskflow/deskflow / cancelThread

Method cancelThread

src/lib/arch/unix/ArchMultithreadPosix.cpp:357–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357void 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
378void ArchMultithreadPosix::setPriorityOfThread(ArchThread thread, int /*n*/)
379{

Callers 2

raiseSignalMethod · 0.45
cancelMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected