| 663 | } |
| 664 | |
| 665 | void 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 | |
| 685 | void CondVar::Signal() |
| 686 | { |
no test coverage detected