59 switch (WaitForSingleObject(
60 _lock, timeout == 0xFFFFFFF ? INFINITE : (DWORD)timeout))
77 if (timeout == 0xFFFFFFFF)
82 else if (timeout == 0)
91 gettimeofday(&
now,
nullptr);
93 wait_time.tv_sec = timeout / 1000 +
now.tv_sec;
94 wait_time.tv_nsec = (timeout % 1000) * 1000000 +
now.tv_usec * 1000;
96 if (wait_time.tv_nsec >= 1000000000)
99 wait_time.tv_nsec -= 1000000000;
101 switch (pthread_mutex_timedlock(&
_lock, &wait_time))
120 pthread_mutex_unlock(&
_lock);
136 pthread_mutex_init(&
_lock,
nullptr);
148 pthread_mutex_destroy(&
_lock);
155 pthread_mutex_t
_lock;
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
Locker::LOCK_STATUS lock(unsigned long timeout=0xFFFFFFFF)