* add file

* CMake freebsd fix
This commit is contained in:
Benjamin Sergeant
2019-10-09 17:00:32 -07:00
committed by GitHub
parent 11a3b64657
commit d2cf616737
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,16 @@
/*
* IXSetThreadName_freebsd.cpp
* Author: Benjamin Sergeant
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
*/
#include "../IXSetThreadName.h"
#include <pthread.h>
#include <pthread_np.h>
namespace ix
{
void setThreadName(const std::string& name)
{
pthread_set_name_np(pthread_self(), name.substr(0, 15).c_str());
}
} // namespace ix