From 56e2e866bd6ef3b15acead8bf0ca65a97feec24d Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 16 Apr 2009 10:33:21 -0400 Subject: [PATCH] hopefully compile win --- db/db.cpp | 2 ++ db/instance.cpp | 2 ++ util/file_allocator.h | 4 ++-- util/util.cpp | 5 +++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/db/db.cpp b/db/db.cpp index 5a3677c5653..c2af3bf7573 100644 --- a/db/db.cpp +++ b/db/db.cpp @@ -363,7 +363,9 @@ namespace mongo { acquirePathLock(); +#if !defined(_WIN32) theFileAllocator().start(); +#endif BOOST_CHECK_EXCEPTION( clearTmpFiles() ); diff --git a/db/instance.cpp b/db/instance.cpp index bee42f979bb..49b2a79c14c 100644 --- a/db/instance.cpp +++ b/db/instance.cpp @@ -656,7 +656,9 @@ namespace mongo { // wait until file preallocation finishes // we would only hang here if the file_allocator code generates a // synchronous signal, which we don't expect +#if !defined(_WIN32) theFileAllocator().waitUntilFinished(); +#endif stringstream ss3; MemoryMappedFile::closeAllFiles( ss3 ); diff --git a/util/file_allocator.h b/util/file_allocator.h index a1b61f29149..3d7cab35882 100644 --- a/util/file_allocator.h +++ b/util/file_allocator.h @@ -23,7 +23,7 @@ #endif namespace mongo { - +#if !defined(_WIN32) // Handles allocation of contiguous files on disk. class FileAllocator { // The public functions may not be called concurrently. The allocation @@ -187,5 +187,5 @@ namespace mongo { }; FileAllocator &theFileAllocator(); - +#endif } // namespace mongo diff --git a/util/util.cpp b/util/util.cpp index ebebf3e8bdf..35f04b2db59 100644 --- a/util/util.cpp +++ b/util/util.cpp @@ -95,9 +95,10 @@ namespace mongo { Top::UsageMap Top::snapshotB_; Top::UsageMap &Top::snapshot_ = Top::snapshotA_; Top::UsageMap &Top::nextSnapshot_ = Top::snapshotB_; - + +#if !defined(_WIN32) // The mutex contained in this object may be held on shutdown. FileAllocator &theFileAllocator_ = *(new FileAllocator()); FileAllocator &theFileAllocator() { return theFileAllocator_; } - +#endif } // namespace mongo