summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2017-06-08 11:38:38 -0400
committerDavid Storch <david.storch@10gen.com>2017-06-08 12:11:03 -0400
commit520b8f3092c48d934f0cd78ab5f40fe594f96863 (patch)
tree2efd7143e56d9d51b204a8f3c952bb5646fcd9cc
parentc3fda2d13c2f60eb3a68564403985cb1c7e8aa43 (diff)
downloadmongo-520b8f3092c48d934f0cd78ab5f40fe594f96863.tar.gz
SERVER-29517 Fix data race by making ViewGraph::_idCounter non-static.r3.4.5-rc4r3.4.5
(cherry picked from commit e2376ccbb43d3fb2579995a55ebf82f7c16fcb4f)
-rw-r--r--src/mongo/db/views/view_graph.cpp1
-rw-r--r--src/mongo/db/views/view_graph.h2
2 files changed, 1 insertions, 2 deletions
diff --git a/src/mongo/db/views/view_graph.cpp b/src/mongo/db/views/view_graph.cpp
index fc40fc4720a..7c613fba9ab 100644
--- a/src/mongo/db/views/view_graph.cpp
+++ b/src/mongo/db/views/view_graph.cpp
@@ -41,7 +41,6 @@ namespace mongo {
const int ViewGraph::kMaxViewPipelineSizeBytes = 16 * 1000 * 1000;
const int ViewGraph::kMaxViewDepth = 20;
-uint64_t ViewGraph::_idCounter = 0;
void ViewGraph::clear() {
_graph.clear();
diff --git a/src/mongo/db/views/view_graph.h b/src/mongo/db/views/view_graph.h
index 8f0e3c8c140..946cb9cb2ca 100644
--- a/src/mongo/db/views/view_graph.h
+++ b/src/mongo/db/views/view_graph.h
@@ -179,6 +179,6 @@ private:
// Maps node ids to nodes. There is a 1-1 correspondence with _namespaceIds, hence the lifetime
// of a node is the same as the lifetime as its corresponding node id.
stdx::unordered_map<uint64_t, Node> _graph;
- static uint64_t _idCounter;
+ uint64_t _idCounter = 0;
};
} // namespace mongo