mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
attempt to fix the pthread_setname_np symbol issue. To be tested
This commit is contained in:
parent
53eb4dfb12
commit
4c986cdc3e
@ -24,13 +24,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "rsthreads.h"
|
||||
#include <unistd.h> // for usleep()
|
||||
#include <errno.h> // for errno
|
||||
#include <iostream>
|
||||
#include <time.h>
|
||||
|
||||
int __attribute__((weak)) pthread_setname_np(pthread_t __target_thread, const char *__buf) ;
|
||||
|
||||
#ifdef RSMUTEX_DEBUG
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
@ -164,8 +165,10 @@ void RsThread::start(const std::string &threadName)
|
||||
mTid = tid;
|
||||
|
||||
// set name
|
||||
#ifdef __USE_GNU
|
||||
if(!threadName.empty()) {
|
||||
|
||||
if(pthread_setname_np)
|
||||
if(!threadName.empty())
|
||||
{
|
||||
// thread names are restricted to 16 characters including the terminating null byte
|
||||
if(threadName.length() > 15)
|
||||
{
|
||||
@ -177,7 +180,6 @@ void RsThread::start(const std::string &threadName)
|
||||
pthread_setname_np(mTid, threadName.c_str());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user