mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Android has pthread_setname_np, but not getname...
This commit is contained in:
parent
98852dbb1e
commit
5cf962e03d
@ -6,6 +6,10 @@
|
|||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
# include <sys/prctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "TracySystem.hpp"
|
#include "TracySystem.hpp"
|
||||||
@ -86,6 +90,11 @@ const char* GetThreadName( uint64_t id )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
#elif defined __ANDROID__
|
||||||
|
if( prctl( PR_GET_NAME, (unsigned long)buf, 0, 0, 0 ) == 0 )
|
||||||
|
{
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
#elif defined _GNU_SOURCE
|
#elif defined _GNU_SOURCE
|
||||||
if( pthread_getname_np( (pthread_t)id, buf, 256 ) == 0 )
|
if( pthread_getname_np( (pthread_t)id, buf, 256 ) == 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user