0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

don't use markAllWritable (a _DEBUG test feature) when dur is on

will be simpler this way.  also the question would be which view to mark writable,
the private or the regular view if it is on...
This commit is contained in:
dwight 2011-03-07 16:19:15 -05:00
parent 8091e7ca70
commit 102afdad3e
2 changed files with 5 additions and 4 deletions

View File

@ -79,8 +79,6 @@ namespace mongo {
void WRITETODATAFILES() {
dbMutex.assertAtLeastReadLocked();
MongoFile::markAllWritable(); // for _DEBUG. normally we don't write in a read lock
Timer t;
#if defined(_EXPERIMENTAL)
WRITETODATAFILES_Impl3();
@ -89,8 +87,6 @@ namespace mongo {
#endif
stats.curr->_writeToDataFilesMicros += t.micros();
if (!dbMutex.isWriteLocked())
MongoFile::unmarkAllWritable();
debugValidateAllMapsMatch();
}

View File

@ -20,6 +20,7 @@
#include "processinfo.h"
#include "concurrency/rwlock.h"
#include "../db/namespace.h"
#include "../db/cmdline.h"
namespace mongo {
@ -173,6 +174,8 @@ namespace mongo {
#if defined(_DEBUG)
void MongoFile::markAllWritable() {
if( cmdLine.dur )
return;
rwlock lk( mmmutex , false );
for ( set<MongoFile*>::iterator i = mmfiles.begin(); i != mmfiles.end(); i++ ) {
MongoFile * mmf = *i;
@ -181,6 +184,8 @@ namespace mongo {
}
void MongoFile::unmarkAllWritable() {
if( cmdLine.dur )
return;
rwlock lk( mmmutex , false );
for ( set<MongoFile*>::iterator i = mmfiles.begin(); i != mmfiles.end(); i++ ) {
MongoFile * mmf = *i;