class ThreadStatusUtil {
public:
// Register the current thread for tracking.
- static void RegisterThread(
- const Env* env, ThreadStatus::ThreadType thread_type);
+ static void RegisterThread(const Env* env,
+ ThreadStatus::ThreadType thread_type);
// Unregister the current thread.
static void UnregisterThread();
static ThreadStatus::OperationStage SetThreadOperationStage(
ThreadStatus::OperationStage stage);
- static void SetThreadOperationProperty(
- int code, uint64_t value);
+ static void SetThreadOperationProperty(int code, uint64_t value);
- static void IncreaseThreadOperationProperty(
- int code, uint64_t delta);
+ static void IncreaseThreadOperationProperty(int code, uint64_t delta);
static void SetThreadState(ThreadStatus::StateType type);
static void ResetThreadStatus();
#ifndef NDEBUG
- static void TEST_SetStateDelay(
- const ThreadStatus::StateType state, int micro);
+ static void TEST_SetStateDelay(const ThreadStatus::StateType state,
+ int micro);
static void TEST_StateDelay(const ThreadStatus::StateType state);
#endif
// When this variable is set to true, thread_updater_local_cache_
// will not be updated until this variable is again set to false
// in UnregisterThread().
- static __thread bool thread_updater_initialized_;
+ static thread_local bool thread_updater_initialized_;
// The thread-local cached ThreadStatusUpdater that caches the
// thread_status_updater_ of the first Env that uses any ThreadStatusUtil
// When thread_updater_initialized_ is set to true, this variable
// will not be updated until this thread_updater_initialized_ is
// again set to false in UnregisterThread().
- static __thread ThreadStatusUpdater* thread_updater_local_cache_;
+ static thread_local ThreadStatusUpdater* thread_updater_local_cache_;
#else
static bool thread_updater_initialized_;
static ThreadStatusUpdater* thread_updater_local_cache_;
// and set the thread state to the previous state in its destructor.
class AutoThreadOperationStageUpdater {
public:
- explicit AutoThreadOperationStageUpdater(
- ThreadStatus::OperationStage stage);
+ explicit AutoThreadOperationStageUpdater(ThreadStatus::OperationStage stage);
~AutoThreadOperationStageUpdater();
#ifdef ROCKSDB_USING_THREAD_STATUS