History

no pthread_[test]cancel on android

Jack Atherton committed 5 years ago

Commit fdabfac1 parent 90c48b61 file · +6 −3Browse files

Showing the changes to src/core/util_thread.cpp (1 of 1 file). Show all

Unified · Split

src/core/util_thread.cpp+6−3
@@ -77,7 +77,8 @@ XThread::~XThread( ) · 76 unmodified lines
77 77
78 if( thread != 0 && !is_self_thread)78 if( thread != 0 && !is_self_thread)
79 {79 {
80#if defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__)80 // TODO: find an alternative for Android?
81#if defined(__PLATFORM_MACOSX__) || ( defined(__PLATFORM_LINUX__) && !defined(__ANDROID__) ) || defined(__WINDOWS_PTHREAD__)
81 pthread_cancel(thread);82 pthread_cancel(thread);
82 pthread_join(thread, NULL);83 pthread_join(thread, NULL);
83#elif defined(__PLATFORM_WIN32__)84#elif defined(__PLATFORM_WIN32__)
@@ -119,7 +120,8 @@ bool XThread::wait( long milliseconds, bool cancel ) · 35 unmodified lines
119{120{
120 bool result = false;121 bool result = false;
121 122
122#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )123 // TODO: find an alternative for Android?
124#if ( defined(__PLATFORM_MACOSX__) || ( defined(__PLATFORM_LINUX__) && !defined(__ANDROID__) ) || defined(__WINDOWS_PTHREAD__) )
123 if(cancel) pthread_cancel(thread);125 if(cancel) pthread_cancel(thread);
124 pthread_join(thread, NULL);126 pthread_join(thread, NULL);
125#elif defined(__PLATFORM_WIN32__)127#elif defined(__PLATFORM_WIN32__)
@@ -146,7 +148,8 @@ bool XThread::wait( long milliseconds, bool cancel ) · 20 unmodified lines
146//-----------------------------------------------------------------------------148//-----------------------------------------------------------------------------
147void XThread :: test( )149void XThread :: test( )
148{150{
149#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )151 // TODO: find an alternative for Android?
152#if ( defined(__PLATFORM_MACOSX__) || ( defined(__PLATFORM_LINUX__) && !defined(__ANDROID__) ) || defined(__WINDOWS_PTHREAD__) )
150 pthread_testcancel();153 pthread_testcancel();
151#endif154#endif
152}155}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t