]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/monitoring/iostats_context.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / rocksdb / monitoring / iostats_context.cc
index e9970e1f7e2953bc11a72362e3fd160940a5ecf9..3d102f912034d460b9316af2b257f6204e498555 100644 (file)
@@ -1,7 +1,7 @@
 // Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-// This source code is licensed under the BSD-style license found in the
-// LICENSE file in the root directory of this source tree. An additional grant
-// of patent rights can be found in the PATENTS file in the same directory.
+//  This source code is licensed under both the GPLv2 (found in the
+//  COPYING file in the root directory) and Apache 2.0 License
+//  (found in the LICENSE.Apache file in the root directory).
 
 #include <sstream>
 #include "monitoring/iostats_context_imp.h"
@@ -9,13 +9,17 @@
 
 namespace rocksdb {
 
-#ifndef IOS_CROSS_COMPILE
-# ifdef _MSC_VER
-__declspec(thread) IOStatsContext iostats_context;
-# else
+#ifdef ROCKSDB_SUPPORT_THREAD_LOCAL
 __thread IOStatsContext iostats_context;
-# endif
-#endif  // IOS_CROSS_COMPILE
+#endif
+
+IOStatsContext* get_iostats_context() {
+#ifdef ROCKSDB_SUPPORT_THREAD_LOCAL
+  return &iostats_context;
+#else
+  return nullptr;
+#endif
+}
 
 void IOStatsContext::Reset() {
   thread_pool_id = Env::Priority::TOTAL;