Changeset 39908 in webkit for trunk/JavaScriptCore/wtf/ThreadingQt.cpp
- Timestamp:
- Jan 14, 2009, 1:57:30 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/ThreadingQt.cpp
r39487 r39908 30 30 #include "Threading.h" 31 31 32 #include "CurrentTime.h" 32 33 #include "HashMap.h" 33 34 #include "MainThread.h" … … 234 235 } 235 236 236 bool ThreadCondition::timedWait(Mutex& mutex, double secondsToWait) 237 { 238 if (secondsToWait < 0.0) { 239 wait(mutex); 240 return true; 241 } 242 243 unsigned long millisecondsToWait = static_cast<unsigned long>(secondsToWait * 1000.0); 244 return m_condition->wait(mutex.impl(), millisecondsToWait); 237 bool ThreadCondition::timedWait(Mutex& mutex, double absoluteTime) 238 { 239 double currentTime = WTF::currentTime(); 240 241 // Time is in the past - return immediately. 242 if (absoluteTime < currentTime) 243 return false; 244 245 double intervalMilliseconds = (absoluteTime - currentTime) * 1000.0; 246 // Qt defines wait for up to ULONG_MAX milliseconds. 247 if (interval >= ULONG_MAX) 248 interval = ULONG_MAX; 249 250 return m_condition->wait(mutex.impl(), static_cast<unsigned long>(interval)); 245 251 } 246 252
Note:
See TracChangeset
for help on using the changeset viewer.