Changeset 50247 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 28, 2009, 4:21:31 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r50239 r50247 1 2009-10-28 Dmitry Titov <[email protected]> 2 3 Reviewed by David Levin. 4 5 https://bugs.webkit.org/show_bug.cgi?id=30805 6 Add MessageQueue::removeIf(Predicate&) to remove certain tasks without pulling them from the queue. 7 Existing Database tests cover this since Database removes tasks when it is stopped. 8 9 * wtf/MessageQueue.h: 10 (WTF::::removeIf): 11 1 12 2009-10-28 Afonso R. Costa Jr. <[email protected]> 2 13 -
trunk/JavaScriptCore/wtf/MessageQueue.h
r45891 r50247 56 56 template<typename Predicate> 57 57 MessageQueueWaitResult waitForMessageFilteredWithTimeout(DataType&, Predicate&, double absoluteTime); 58 void kill(); 58 59 template<typename Predicate> 60 void removeIf(Predicate&); 59 61 60 62 bool tryGetMessage(DataType&); 63 64 void kill(); 61 65 bool killed() const; 62 66 … … 150 154 151 155 template<typename DataType> 156 template<typename Predicate> 157 inline void MessageQueue<DataType>::removeIf(Predicate& predicate) 158 { 159 MutexLocker lock(m_mutex); 160 DequeConstIterator<DataType> found = m_queue.end(); 161 while ((found = m_queue.findIf(predicate)) != m_queue.end()) { 162 m_queue.remove(found); 163 } 164 } 165 166 template<typename DataType> 152 167 inline bool MessageQueue<DataType>::isEmpty() 153 168 {
Note:
See TracChangeset
for help on using the changeset viewer.