Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

unify linux logging (glibc / musl) #72

Merged
merged 1 commit into from
May 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions libdevcore/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* l

string dev::getThreadName()
{
#if defined(__linux__) || defined(__APPLE__)
#if defined(__APPLE__)
char buffer[128];
pthread_getname_np(pthread_self(), buffer, 127);
buffer[127] = 0;
Expand All @@ -187,9 +187,7 @@ string dev::getThreadName()

void dev::setThreadName(string const& _n)
{
#if defined(__linux__)
pthread_setname_np(pthread_self(), _n.c_str());
#elif defined(__APPLE__)
#if defined(__APPLE__)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean like this? Or shall I just cut the pthread naming entirely for all platforms?

pthread_setname_np(_n.c_str());
#else
g_logThreadName.m_name.reset(new std::string(_n));
Expand Down