diff options
author | Eric Milkie <milkie@10gen.com> | 2012-04-30 13:42:02 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2012-04-30 13:42:17 -0400 |
commit | 8b099a96ac9b5a1f73954204806ef8e0c77d481a (patch) | |
tree | 9ebb17c3e01e84ff4281577919c226731fec94cd /src/mongo/db/dur.cpp | |
parent | 100b489788f4c335e6df88606804c589f7cd6a5b (diff) | |
download | mongo-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.cpp | 9 |
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 ) |