Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: Source/WTF/wtf/MessageQueue.h

Issue 12096050: Merge 140483 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/WebCore/workers/WorkerRunLoop.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WTF/wtf/MessageQueue.h
===================================================================
--- Source/WTF/wtf/MessageQueue.h (revision 141168)
+++ Source/WTF/wtf/MessageQueue.h (working copy)
@@ -55,6 +55,7 @@
~MessageQueue();
void append(PassOwnPtr<DataType>);
+ void appendAndKill(PassOwnPtr<DataType>);
bool appendAndCheckEmpty(PassOwnPtr<DataType>);
void prepend(PassOwnPtr<DataType>);
@@ -98,6 +99,15 @@
m_condition.signal();
}
+ template<typename DataType>
+ inline void MessageQueue<DataType>::appendAndKill(PassOwnPtr<DataType> message)
+ {
+ MutexLocker lock(m_mutex);
+ m_queue.append(message.leakPtr());
+ m_killed = true;
+ m_condition.broadcast();
+ }
+
// Returns true if the queue was empty before the item was added.
template<typename DataType>
inline bool MessageQueue<DataType>::appendAndCheckEmpty(PassOwnPtr<DataType> message)
« no previous file with comments | « no previous file | Source/WebCore/workers/WorkerRunLoop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698