// 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"
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;