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

Unified Diff: src/IceThreading.h

Issue 1197223002: Subzero: Use C++11 member initializers where practical. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 5 years, 6 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 | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTimerTree.h » ('j') | 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 35e1bfbfb52fc7a6437d6b4fd4b48b81505c2e97..12b085d40bf220a491dbb5d47abf57bfc6b1f563 100644
--- a/src/IceThreading.h
+++ b/src/IceThreading.h
@@ -55,8 +55,7 @@ class BoundedProducerConsumerQueue {
public:
BoundedProducerConsumerQueue(bool Sequential, size_t MaxSize = MaxStaticSize)
- : Back(0), Front(0), MaxSize(std::min(MaxSize, MaxStaticSize)),
- Sequential(Sequential), IsEnded(false) {}
+ : MaxSize(std::min(MaxSize, MaxStaticSize)), Sequential(Sequential) {}
void blockingPush(T *Item) {
{
std::unique_lock<GlobalLockType> L(Lock);
@@ -112,7 +111,7 @@ private:
// be pushed. (More precisely, Back&MaxStaticSize is the index.)
// It is written by the producers, and read by all via size() and
// empty().
- size_t Back;
+ size_t Back = 0;
ICE_CACHELINE_BOUNDARY;
// Shrunk is notified (by the consumer) when something is removed
@@ -124,7 +123,7 @@ private:
// i.e. the next to be popped. (More precisely Front&MaxStaticSize
// is the index.) It is written by the consumers, and read by all
// via size() and empty().
- size_t Front;
+ size_t Front = 0;
ICE_CACHELINE_BOUNDARY;
@@ -133,7 +132,7 @@ private:
const bool Sequential;
// IsEnded is read by the consumers, and only written once by the
// producer.
- bool IsEnded;
+ bool IsEnded = false;
// The lock must be held when the following methods are called.
bool empty() const { return Front == Back; }
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTimerTree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698