allocate files in background

This commit is contained in:
Aaron
2009-04-15 11:58:38 -04:00
parent ae6ea34242
commit 0033bd91df
12 changed files with 237 additions and 60 deletions

View File

@@ -30,6 +30,7 @@
#include "reccache.h"
#include "replset.h"
#include "../s/d_logic.h"
#include "../util/file_allocator.h"
#if !defined(_WIN32)
#include <sys/file.h>
#endif
@@ -652,6 +653,11 @@ namespace mongo {
/* must do this before unmapping mem or you may get a seg fault */
closeAllSockets();
// wait until file preallocation finishes
// we would only hang here if the file_allocator code generates a
// synchronous signal, which we don't expect
theFileAllocator().waitUntilFinished();
stringstream ss3;
MemoryMappedFile::closeAllFiles( ss3 );
rawOut( ss3.str() );