summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-11-04 14:48:40 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-11-04 14:48:40 (GMT)
commitb4ef8b906c88e5d60e687d9018af93de0e735e0c (patch)
treefe4167319039047ba3ac0c97651dddc0a526349b /src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h
parentf4f6012d181cf60fd04fc5bf69b21786977f0de0 (diff)
parent9cda9fb4bb496a7c589767bdcead131dbcdeeb79 (diff)
downloadQt-b4ef8b906c88e5d60e687d9018af93de0e735e0c.zip
Qt-b4ef8b906c88e5d60e687d9018af93de0e735e0c.tar.gz
Qt-b4ef8b906c88e5d60e687d9018af93de0e735e0c.tar.bz2
Merge commit 's60/4.6' into mmfphonon
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h b/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h
index 12291cc..9c9a4a7 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h
@@ -55,9 +55,13 @@ namespace WTF {
bool waitForMessage(DataType&);
template<typename Predicate>
MessageQueueWaitResult waitForMessageFilteredWithTimeout(DataType&, Predicate&, double absoluteTime);
- void kill();
+
+ template<typename Predicate>
+ void removeIf(Predicate&);
bool tryGetMessage(DataType&);
+
+ void kill();
bool killed() const;
// The result of isEmpty() is only valid if no other thread is manipulating the queue at the same time.
@@ -149,6 +153,17 @@ namespace WTF {
}
template<typename DataType>
+ template<typename Predicate>
+ inline void MessageQueue<DataType>::removeIf(Predicate& predicate)
+ {
+ MutexLocker lock(m_mutex);
+ DequeConstIterator<DataType> found = m_queue.end();
+ while ((found = m_queue.findIf(predicate)) != m_queue.end()) {
+ m_queue.remove(found);
+ }
+ }
+
+ template<typename DataType>
inline bool MessageQueue<DataType>::isEmpty()
{
MutexLocker lock(m_mutex);