From 560fc34ae6aff2f1c456734f8beda2a6e16e8923 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 7 Sep 2018 17:21:27 +0200 Subject: [PATCH] No pthread_setcancelstate on Android. --- common/TracySystem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/TracySystem.cpp b/common/TracySystem.cpp index 6775fbb8..235b2cfc 100644 --- a/common/TracySystem.cpp +++ b/common/TracySystem.cpp @@ -165,14 +165,18 @@ const char* GetThreadName( uint64_t id ) # endif snprintf( path, sizeof( path ), "/proc/self/task/%d/comm", tid ); sprintf( buf, "%" PRIu64, id ); +# ifndef __ANDROID__ pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &cs ); +# endif if ( ( fd = open( path, O_RDONLY ) ) > 0) { int len = read( fd, buf, 255 ); if ( len > 0 ) buf[len] = 0; close( fd ); } +# ifndef __ANDROID__ pthread_setcancelstate( cs, 0 ); +# endif return buf; # endif #endif