proof of concept server implementation

This commit is contained in:
Benjamin Sergeant
2018-12-29 23:15:27 -08:00
parent ea07afcc0b
commit 0ee71e9a09
9 changed files with 324 additions and 3 deletions

View File

@ -0,0 +1,20 @@
/*
* IXSetThreadName_apple.cpp
* Author: Benjamin Sergeant
* Copyright (c) 2018 Machine Zone, Inc. All rights reserved.
*/
#include "../IXSetThreadName.h"
#include <pthread.h>
namespace ix
{
void setThreadName(const std::string& name)
{
//
// Apple reserves 16 bytes for its thread names
// Notice that the Apple version of pthread_setname_np
// does not take a pthread_t argument
//
pthread_setname_np(name.substr(0, 63).c_str());
}
}