|
|
@ -2110,29 +2110,23 @@ class WinEnv : public Env { |
|
|
|
std::vector<ThreadPool> thread_pools_; |
|
|
|
std::vector<ThreadPool> thread_pools_; |
|
|
|
mutable std::mutex mu_; |
|
|
|
mutable std::mutex mu_; |
|
|
|
std::vector<std::thread> threads_to_join_; |
|
|
|
std::vector<std::thread> threads_to_join_; |
|
|
|
static FnGetSystemTimePreciseAsFileTime GetSystemTimePreciseAsFileTime_; |
|
|
|
FnGetSystemTimePreciseAsFileTime GetSystemTimePreciseAsFileTime_; |
|
|
|
static bool GetSystemTimePreciseAsFileTimeInitialized_; |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FnGetSystemTimePreciseAsFileTime WinEnv::GetSystemTimePreciseAsFileTime_ = NULL; |
|
|
|
|
|
|
|
bool WinEnv::GetSystemTimePreciseAsFileTimeInitialized_ = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WinEnv::WinEnv() |
|
|
|
WinEnv::WinEnv() |
|
|
|
: checkedDiskForMmap_(false), |
|
|
|
: checkedDiskForMmap_(false), |
|
|
|
forceMmapOff(false), |
|
|
|
forceMmapOff(false), |
|
|
|
page_size_(4 * 1012), |
|
|
|
page_size_(4 * 1012), |
|
|
|
allocation_granularity_(page_size_), |
|
|
|
allocation_granularity_(page_size_), |
|
|
|
perf_counter_frequency_(0), |
|
|
|
perf_counter_frequency_(0), |
|
|
|
thread_pools_(Priority::TOTAL) { |
|
|
|
thread_pools_(Priority::TOTAL), |
|
|
|
|
|
|
|
GetSystemTimePreciseAsFileTime_(NULL) { |
|
|
|
|
|
|
|
|
|
|
|
if (!GetSystemTimePreciseAsFileTimeInitialized_) { |
|
|
|
|
|
|
|
HMODULE module = GetModuleHandle("kernel32.dll"); |
|
|
|
HMODULE module = GetModuleHandle("kernel32.dll"); |
|
|
|
if (module != NULL) { |
|
|
|
if (module != NULL) { |
|
|
|
GetSystemTimePreciseAsFileTime_ = (FnGetSystemTimePreciseAsFileTime)GetProcAddress( |
|
|
|
GetSystemTimePreciseAsFileTime_ = (FnGetSystemTimePreciseAsFileTime)GetProcAddress( |
|
|
|
module, "GetSystemTimePreciseAsFileTime"); |
|
|
|
module, "GetSystemTimePreciseAsFileTime"); |
|
|
|
} |
|
|
|
} |
|
|
|
GetSystemTimePreciseAsFileTimeInitialized_ = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SYSTEM_INFO sinfo; |
|
|
|
SYSTEM_INFO sinfo; |
|
|
|
GetSystemInfo(&sinfo); |
|
|
|
GetSystemInfo(&sinfo); |
|
|
|