bool Threading::Mutex::AcquireWithoutYield( const wxTimeSpan& timeout ) { wxDateTime megafail( wxDateTime::UNow() + timeout ); const timespec fail = { megafail.GetTicks(), megafail.GetMillisecond() * 1000000 }; return xpthread_mutex_timedlock( &m_mutex, &fail ) == 0; }
bool Threading::Semaphore::WaitWithoutYield(const wxTimeSpan &timeout) { wxDateTime megafail(wxDateTime::UNow() + timeout); const timespec fail = {megafail.GetTicks(), megafail.GetMillisecond() * 1000000}; return sem_timedwait(&m_sema, &fail) == 0; }