MCPcopy Create free account
hub / github.com/InoriRus/Kyty / WaitFor

Method WaitFor

source/lib/Core/src/Threads.cpp:665–683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663}
664
665void CondVar::WaitFor(Mutex* mutex, uint32_t micros)
666{
667#if defined(KYTY_DEBUG_LOCKS) || defined(KYTY_DEBUG_LOCKS_TIMED)
668 std::unique_lock<std::recursive_timed_mutex> cpp_lock(mutex->m_mutex->m_mutex, std::adopt_lock_t());
669#else
670#ifdef KYTY_WIN_CS
671#else
672 std::unique_lock<std::recursive_mutex> cpp_lock(mutex->m_mutex->m_mutex, std::adopt_lock_t());
673#endif
674#endif
675#if !(defined(KYTY_DEBUG_LOCKS) || defined(KYTY_DEBUG_LOCKS_TIMED)) && defined(KYTY_WIN_CS)
676 static auto func = ResolveSleepConditionVariableCS();
677 EXIT_NOT_IMPLEMENTED(func == nullptr);
678 func(&m_cond_var->m_cv, &mutex->m_mutex->m_cs, (micros < 1000 ? 1 : micros / 1000));
679#else
680 m_cond_var->m_cv.wait_for(cpp_lock, std::chrono::microseconds(micros));
681 cpp_lock.release();
682#endif
683}
684
685void CondVar::Signal()
686{

Callers 4

FlipMethod · 0.80
WaitMethod · 0.80
WaitForEventsMethod · 0.80
WaitMethod · 0.80

Calls 2

releaseMethod · 0.80

Tested by

no test coverage detected