summaryrefslogtreecommitdiff
path: root/src/mongo/db/dur.cpp
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2012-04-30 13:42:02 -0400
committerEric Milkie <milkie@10gen.com>2012-04-30 13:42:17 -0400
commit8b099a96ac9b5a1f73954204806ef8e0c77d481a (patch)
tree9ebb17c3e01e84ff4281577919c226731fec94cd /src/mongo/db/dur.cpp
parent100b489788f4c335e6df88606804c589f7cd6a5b (diff)
downloadmongo-8b099a96ac9b5a1f73954204806ef8e0c77d481a.tar.gz
SERVER-5680 fix Windows accvios due to incorrect recursive locking of MongoFiles
Diffstat (limited to 'src/mongo/db/dur.cpp')
-rw-r--r--src/mongo/db/dur.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/dur.cpp b/src/mongo/db/dur.cpp
index 83dba89711e..1c34d5a91fa 100644
--- a/src/mongo/db/dur.cpp
+++ b/src/mongo/db/dur.cpp
@@ -469,7 +469,16 @@ namespace mongo {
fraction = 1;
lastRemap = now;
+#if defined(_WIN32)
+ // Note that this negatively affects performance.
+ // We must grab the exclusive lock here because remapThePrivateView() on Windows needs
+ // to grab it as well, due to the lack of a non-atomic way to remap a memory mapped file.
+ // See SERVER-5723 for performance improvement.
+ // See SERVER-5680 to see why this code is necessary.
+ LockMongoFilesExclusive lk;
+#else
LockMongoFilesShared lk;
+#endif
set<MongoFile*>& files = MongoFile::getAllFiles();
unsigned sz = files.size();
if( sz == 0 )