I have a mutex in my class with the following definition:
ACE_Mutex m_specsMutex;
When i use the acquire() method that takes no parameters everything works just fine. But when i use it with a time value (as follows) it just immediately returns with -1 value. I’m sure that this mutex hasn’t been acquired anywhere else so it shouldn’t return -1.
m_specsMutex.acquire(ACE_OS::gettimeofday() + ACE_Time_Value(30))
Am i doing anything wrong?
Browing through the doxygen docs for ACE_Mutex, I don’t understand how your code could possibly compile. The time-out value (tv) is passed either by reference or a pointer so that acquire() can update the absolute time at which the mutex was acquired. You cannot pass an expression. Try it like this: