Skip to content

Commit

Permalink
maint: Remove use of folly/system/ThreadName.h
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Thomas <[email protected]>
  • Loading branch information
ianthomas23 committed Mar 20, 2024
1 parent 2f70374 commit 546896f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cpp/arcticdb/entity/performance_tracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#include <arcticdb/entity/performance_tracing.hpp>
#include <arcticdb/log/log.hpp>
#include <folly/system/ThreadName.h>
#include <arcticdb/util/preprocess.hpp>
#include <arcticdb/util/pb_util.hpp>
#include <arcticdb/util/storage_lock.hpp>

std::shared_ptr<RemoteryInstance> RemoteryInstance::instance(){
std::call_once(RemoteryInstance::init_flag_, &RemoteryInstance::init);
Expand Down Expand Up @@ -63,7 +63,7 @@ namespace arcticdb::detail {
std::unordered_map<const char *, std::string> fqn_by_task_name_;
std::string thread_name_;

ThreadNameCache():fqn_by_task_name_(),thread_name_(folly::getCurrentThreadName().value_or("Thread")){}
ThreadNameCache():fqn_by_task_name_(),thread_name_(fmt::format("{}", arcticdb::get_thread_id())){}

std::string_view get_thread_name(const char * task_name){
if(auto fqn_it = fqn_by_task_name_.find(task_name); fqn_it != fqn_by_task_name_.end()){
Expand Down
4 changes: 2 additions & 2 deletions cpp/arcticdb/python/python_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include <arcticdb/util/type_handler.hpp>
#include <arcticdb/python/python_handlers.hpp>
#include <arcticdb/util/pybind_mutex.hpp>
#include <arcticdb/util/storage_lock.hpp>

#include <pybind11/pybind11.h>
#include <folly/system/ThreadName.h>
#include <folly/portability/PThread.h>
#include <mongocxx/exception/logic_error.hpp>

Expand Down Expand Up @@ -175,7 +175,7 @@ void register_termination_handler() {
std::rethrow_exception(eptr);
} catch (const std::exception &e) {
arcticdb::log::root().error("Terminate called in thread {}: {}\n Aborting",
folly::getCurrentThreadName().value_or("Unknown"), e.what());
arcticdb::get_thread_id(), e.what());
std::abort();
}
});
Expand Down

0 comments on commit 546896f

Please sign in to comment.