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

Unified Diff: base/message_loop.cc

Issue 190006: Make swapping the incoming queue with the work queue constant time.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 4 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
« base/message_loop.h ('K') | « base/message_loop.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop.cc
===================================================================
--- base/message_loop.cc (revision 25087)
+++ base/message_loop.cc (working copy)
@@ -354,7 +354,7 @@
AutoLock lock(incoming_queue_lock_);
if (incoming_queue_.empty())
return;
- std::swap(incoming_queue_, work_queue_);
+ incoming_queue_.Swap(&work_queue_); // Constant time
DCHECK(incoming_queue_.empty());
}
}
« base/message_loop.h ('K') | « base/message_loop.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698