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

Unified Diff: src/IceThreading.h

Issue 1877873002: Reduce wait times for very large PEXE files. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nit. Created 4 years, 8 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
« src/IceGlobalContext.h ('K') | « src/IceGlobalContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceThreading.h
diff --git a/src/IceThreading.h b/src/IceThreading.h
index 40ada47c1622d4780cfe7fd3b5b5f83301795910..1cdca8e764a9d1a6536f99e4955ac40b826a96c1 100644
--- a/src/IceThreading.h
+++ b/src/IceThreading.h
@@ -67,7 +67,7 @@ public:
}
GrewOrEnded.notify_one();
}
- std::unique_ptr<T> blockingPop() {
+ std::unique_ptr<T> blockingPop(size_t NotifyWhenDownToSize = MaxStaticSize) {
Jim Stichnoth 2016/04/13 15:33:19 Would it make sense to also apply this to blocking
std::unique_ptr<T> Item;
bool ShouldNotifyProducer = false;
{
@@ -75,7 +75,7 @@ public:
GrewOrEnded.wait(L, [this] { return IsEnded || !empty() || Sequential; });
if (!empty()) {
Item = pop();
- ShouldNotifyProducer = !IsEnded;
+ ShouldNotifyProducer = (size() < NotifyWhenDownToSize) && !IsEnded;
}
}
if (ShouldNotifyProducer)
« src/IceGlobalContext.h ('K') | « src/IceGlobalContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698