Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SERVER-5680 fix Windows accvios due to incorrect recursive locking of…

… MongoFiles

Conflicts:
	db/dur.cpp
  • Loading branch information...
commit c88805a6f6447458290719703887fb736692359e 1 parent 7542d7b
@milkie milkie authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 db/dur.cpp
View
10 db/dur.cpp
@@ -434,7 +434,17 @@ 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.
+ RWLockRecursive::Exclusive lk(MongoFile::mmmutex);
+#else
RWLockRecursive::Shared lk(MongoFile::mmmutex);
+#endif
+
set<MongoFile*>& files = MongoFile::getAllFiles();
unsigned sz = files.size();
if( sz == 0 )
Please sign in to comment.
Something went wrong with that request. Please try again.