1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
6 // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style license that can be
8 // found in the LICENSE file. See the AUTHORS file for names of contributors.
12 #include <rocksdb/env.h>
13 #include "port/win/env_win.h"
14 #include "util/compression_context_cache.h"
15 #include "util/sync_point.h"
16 #include "util/thread_local.h"
21 // We choose not to destroy the env because joining the threads from the
23 // which destroys the statics (same as from DLLMain) creates a system loader
25 // in this manner any remaining threads are terminated OK.
27 std::once_flag winenv_once_flag
;
34 ThreadLocalPtr::InitSingletons();
35 CompressionContextCache::InitSingleton();
36 INIT_SYNC_POINT_SINGLETONS();
37 std::call_once(winenv_once_flag
, []() { envptr
= new WinEnv(); });