Ignore:
Timestamp:
Jan 14, 2009, 1:57:30 PM (16 years ago)
Author:
[email protected]
Message:

2009-01-14 Dmitry Titov <[email protected]>

Reviewed by Alexey Proskuryakov.

https://bugs.webkit.org/show_bug.cgi?id=23312
Implement MessageQueue::waitForMessageTimed()
Also fixed ThreadCondition::timedWait() to take absolute time, as discussed on webkit-dev.
Win32 version of timedWait still has to be implemented.

  • wtf/MessageQueue.h: (WTF::MessageQueueWaitResult: new enum for the result of MessageQueue::waitForMessageTimed. (WTF::MessageQueue::waitForMessage): (WTF::MessageQueue::waitForMessageTimed): New method.
  • wtf/Threading.h:
  • wtf/ThreadingGtk.cpp: (WTF::ThreadCondition::timedWait): changed to use absolute time instead of interval.
  • wtf/ThreadingNone.cpp: (WTF::ThreadCondition::timedWait): ditto.
  • wtf/ThreadingPthreads.cpp: (WTF::ThreadCondition::timedWait): ditto.
  • wtf/ThreadingQt.cpp: (WTF::ThreadCondition::timedWait): ditto.
  • wtf/ThreadingWin.cpp: (WTF::ThreadCondition::timedWait): ditto. The actual Win32 code is still to be implemented.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Threading.h

    r39487 r39908  
    168168   
    169169    void wait(Mutex& mutex);
    170     // Returns true if the condition was signaled before the timeout, false if the timeout was reached
    171     bool timedWait(Mutex&, double interval);
     170    // Returns true if the condition was signaled before absoluteTime, false if the absoluteTime was reached or is in the past.
     171    // The absoluteTime is in seconds, starting on January 1, 1970. The time is assumed to use the same time zone as WTF::currentTime().
     172    bool timedWait(Mutex&, double absoluteTime);
    172173    void signal();
    173174    void broadcast();
Note: See TracChangeset for help on using the changeset viewer.