mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
No pthread_setcancelstate on Android.
This commit is contained in:
parent
d7d4c26990
commit
560fc34ae6
@ -165,14 +165,18 @@ const char* GetThreadName( uint64_t id )
|
|||||||
# endif
|
# endif
|
||||||
snprintf( path, sizeof( path ), "/proc/self/task/%d/comm", tid );
|
snprintf( path, sizeof( path ), "/proc/self/task/%d/comm", tid );
|
||||||
sprintf( buf, "%" PRIu64, id );
|
sprintf( buf, "%" PRIu64, id );
|
||||||
|
# ifndef __ANDROID__
|
||||||
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &cs );
|
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &cs );
|
||||||
|
# endif
|
||||||
if ( ( fd = open( path, O_RDONLY ) ) > 0) {
|
if ( ( fd = open( path, O_RDONLY ) ) > 0) {
|
||||||
int len = read( fd, buf, 255 );
|
int len = read( fd, buf, 255 );
|
||||||
if ( len > 0 )
|
if ( len > 0 )
|
||||||
buf[len] = 0;
|
buf[len] = 0;
|
||||||
close( fd );
|
close( fd );
|
||||||
}
|
}
|
||||||
|
# ifndef __ANDROID__
|
||||||
pthread_setcancelstate( cs, 0 );
|
pthread_setcancelstate( cs, 0 );
|
||||||
|
# endif
|
||||||
return buf;
|
return buf;
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user