Skip to content

Commit

Permalink
fix linking without thread status support
Browse files Browse the repository at this point in the history
When compiling with `-DNROCKSDB_THREAD_STATUS`, some functions in
ThreadStatusUtil are declared but their definition is missing. Their
definitions are only compiled when not defining `NROCKSDB_THREAD_STATUS`.
This causes problems on linking, when the linker cannot find the
definitions of
- ThreadStatusUtil::GetThreadOperation
- ThreadStatusUtil::SetEnableTracking

This PR fixes it by adding stubs for these functions in case
`NROCKSDB_THREAD_STATUS` is defined.
  • Loading branch information
jsteemann committed Mar 1, 2024
1 parent 4aed229 commit cb184c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions monitoring/thread_status_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,14 @@ bool ThreadStatusUtil::MaybeInitThreadLocalUpdater(const Env* /*env*/) {
return false;
}

void ThreadStatusUtil::SetEnableTracking(bool /*enable_tracking*/) {}

void ThreadStatusUtil::SetColumnFamily(const ColumnFamilyData* /*cfd*/) {}

ThreadStatus::OperationType ThreadStatusUtil::GetThreadOperation() {
return ThreadStatus::OperationType::OP_UNKNOWN;
}

void ThreadStatusUtil::SetThreadOperation(ThreadStatus::OperationType /*op*/) {}

void ThreadStatusUtil::SetThreadOperationProperty(int /*code*/,
Expand Down

0 comments on commit cb184c9

Please sign in to comment.