This commit is contained in:
Gasper Jansa
2011-01-06 17:14:26 +01:00
17 changed files with 363 additions and 66 deletions

View File

@@ -41,6 +41,10 @@ ReferenceCountingLock::~ReferenceCountingLock()
bool ReferenceCountingLock::acquire(int64 msecs)
{
#ifdef darwin
// timedlock not supported by Darwin OS
return (pthread_mutex_lock(&_mutex) == 0);
#else
struct timespec deltatime;
deltatime.tv_sec = msecs / 1000;
deltatime.tv_nsec = (msecs % 1000) * 1000;
@@ -51,6 +55,7 @@ bool ReferenceCountingLock::acquire(int64 msecs)
return true;
}
return false;
#endif
}
void ReferenceCountingLock::release()