36 namespace rp{
namespace hal{
63 switch (WaitForSingleObject(
_lock, timeout==0xFFFFFFF?INFINITE:(DWORD)timeout))
79 if (timeout == 0xFFFFFFFF){
83 else if (timeout == 0)
92 gettimeofday(&
now,NULL);
94 wait_time.tv_sec = timeout/1000 +
now.tv_sec;
95 wait_time.tv_nsec = (timeout%1000)*1000000 +
now.tv_usec*1000;
97 if (wait_time.tv_nsec >= 1000000000)
100 wait_time.tv_nsec -= 1000000000;
102 switch (pthread_mutex_timedlock(&
_lock,&wait_time))
122 pthread_mutex_unlock(&
_lock);
146 pthread_mutex_init(&
_lock, NULL);
158 pthread_mutex_destroy(&
_lock);
165 pthread_mutex_t
_lock;
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
Locker::LOCK_STATUS lock(unsigned long timeout=0xFFFFFFFF)