summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-07-06 21:06:36 -0400
committerAndrew Morrow <acm@mongodb.com>2015-07-09 13:49:39 -0400
commit932e768dc264865d683c113e35985b78425f78d9 (patch)
tree3b0d01bb663745e9b366daef53633ca75fbf5e59 /src/mongo/db/concurrency
parent7e6df189868bdb2e2b991f0733dc1486b41c69b1 (diff)
downloadmongo-932e768dc264865d683c113e35985b78425f78d9.tar.gz
SERVER-19313 Remove some obsoleted usages of boost
Diffstat (limited to 'src/mongo/db/concurrency')
-rw-r--r--src/mongo/db/concurrency/fast_map_noalloc.h4
-rw-r--r--src/mongo/db/concurrency/lock_manager.cpp21
-rw-r--r--src/mongo/db/concurrency/lock_manager_defs.h6
3 files changed, 17 insertions, 14 deletions
diff --git a/src/mongo/db/concurrency/fast_map_noalloc.h b/src/mongo/db/concurrency/fast_map_noalloc.h
index cc2ccdb64ae..eef9f4ceebe 100644
--- a/src/mongo/db/concurrency/fast_map_noalloc.h
+++ b/src/mongo/db/concurrency/fast_map_noalloc.h
@@ -233,8 +233,8 @@ public:
private:
// Empty and very large maps do not make sense since there will be no performance gain, so
// disallow them.
- BOOST_STATIC_ASSERT(PreallocCount > 0);
- BOOST_STATIC_ASSERT(PreallocCount < 32);
+ static_assert(PreallocCount > 0, "PreallocCount > 0");
+ static_assert(PreallocCount < 32, "PreallocCount < 32");
// Iterator accesses the map directly
friend class IteratorImpl<FastMapNoAlloc<KeyType, ValueType, PreallocCount>, ValueType>;
diff --git a/src/mongo/db/concurrency/lock_manager.cpp b/src/mongo/db/concurrency/lock_manager.cpp
index c82e2d0ee5c..f28c40d16cf 100644
--- a/src/mongo/db/concurrency/lock_manager.cpp
+++ b/src/mongo/db/concurrency/lock_manager.cpp
@@ -72,7 +72,8 @@ static const int LockConflictsTable[] = {
const uint64_t intentModes = (1 << MODE_IS) | (1 << MODE_IX);
// Ensure we do not add new modes without updating the conflicts table
-BOOST_STATIC_ASSERT((sizeof(LockConflictsTable) / sizeof(LockConflictsTable[0])) == LockModesCount);
+static_assert((sizeof(LockConflictsTable) / sizeof(LockConflictsTable[0])) == LockModesCount,
+ "(sizeof(LockConflictsTable) / sizeof(LockConflictsTable[0])) == LockModesCount");
/**
@@ -83,10 +84,10 @@ static const char* LockModeNames[] = {"NONE", "IS", "IX", "S", "X"};
static const char* LegacyLockModeNames[] = {"", "r", "w", "R", "W"};
// Ensure we do not add new modes without updating the names array
-BOOST_STATIC_ASSERT((sizeof(LockModeNames) / sizeof(LockModeNames[0])) == LockModesCount);
-BOOST_STATIC_ASSERT((sizeof(LegacyLockModeNames) / sizeof(LegacyLockModeNames[0])) ==
- LockModesCount);
-
+static_assert((sizeof(LockModeNames) / sizeof(LockModeNames[0])) == LockModesCount,
+ "(sizeof(LockModeNames) / sizeof(LockModeNames[0])) == LockModesCount");
+static_assert((sizeof(LegacyLockModeNames) / sizeof(LegacyLockModeNames[0])) == LockModesCount,
+ "(sizeof(LegacyLockModeNames) / sizeof(LegacyLockModeNames[0])) == LockModesCount");
// Helper functions for the lock modes
bool conflicts(LockMode newMode, uint32_t existingModesMask) {
@@ -106,8 +107,8 @@ static const char* ResourceTypeNames[] = {
};
// Ensure we do not add new types without updating the names array
-BOOST_STATIC_ASSERT((sizeof(ResourceTypeNames) / sizeof(ResourceTypeNames[0])) ==
- ResourceTypesCount);
+static_assert((sizeof(ResourceTypeNames) / sizeof(ResourceTypeNames[0])) == ResourceTypesCount,
+ "(sizeof(ResourceTypeNames) / sizeof(ResourceTypeNames[0])) == ResourceTypesCount");
/**
@@ -118,8 +119,10 @@ static const char* LockRequestStatusNames[] = {
};
// Ensure we do not add new status types without updating the names array
-BOOST_STATIC_ASSERT((sizeof(LockRequestStatusNames) / sizeof(LockRequestStatusNames[0])) ==
- LockRequest::StatusCount);
+static_assert((sizeof(LockRequestStatusNames) / sizeof(LockRequestStatusNames[0])) ==
+ LockRequest::StatusCount,
+ "(sizeof(LockRequestStatusNames) / sizeof(LockRequestStatusNames[0])) == "
+ "LockRequest::StatusCount");
} // namespace
diff --git a/src/mongo/db/concurrency/lock_manager_defs.h b/src/mongo/db/concurrency/lock_manager_defs.h
index 86bce16a659..1ca3f70dbe2 100644
--- a/src/mongo/db/concurrency/lock_manager_defs.h
+++ b/src/mongo/db/concurrency/lock_manager_defs.h
@@ -28,7 +28,6 @@
#pragma once
-#include <boost/static_assert.hpp>
#include <cstdint>
#include <string>
#include <limits>
@@ -173,7 +172,8 @@ const char* resourceTypeName(ResourceType resourceType);
class ResourceId {
// We only use 3 bits for the resource type in the ResourceId hash
enum { resourceTypeBits = 3 };
- BOOST_STATIC_ASSERT(ResourceTypesCount <= (1 << resourceTypeBits));
+ static_assert(ResourceTypesCount <= (1 << resourceTypeBits),
+ "ResourceTypesCount <= (1 << resourceTypeBits)");
public:
/**
@@ -236,7 +236,7 @@ private:
#ifndef MONGO_CONFIG_DEBUG_BUILD
// Treat the resource ids as 64-bit integers in release mode in order to ensure we do
// not spend too much time doing comparisons for hashing.
-BOOST_STATIC_ASSERT(sizeof(ResourceId) == sizeof(uint64_t));
+static_assert(sizeof(ResourceId) == sizeof(uint64_t), "sizeof(ResourceId) == sizeof(uint64_t)");
#endif