mirror of
https://github.com/boostorg/core.git
synced 2025-05-11 13:13:55 +00:00
Android doesn't support pthread_setcancelstate. Fixes #150.
This commit is contained in:
parent
216999e552
commit
c7134904e2
@ -56,7 +56,7 @@ using boost::core::detail::sp_thread_sleep;
|
|||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#if defined(BOOST_HAS_PTHREADS)
|
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__)
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ namespace core
|
|||||||
|
|
||||||
inline void sp_thread_sleep() BOOST_NOEXCEPT
|
inline void sp_thread_sleep() BOOST_NOEXCEPT
|
||||||
{
|
{
|
||||||
#if defined(BOOST_HAS_PTHREADS)
|
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__)
|
||||||
|
|
||||||
int oldst;
|
int oldst;
|
||||||
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &oldst );
|
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &oldst );
|
||||||
@ -85,7 +85,7 @@ inline void sp_thread_sleep() BOOST_NOEXCEPT
|
|||||||
|
|
||||||
nanosleep( &rqtp, 0 );
|
nanosleep( &rqtp, 0 );
|
||||||
|
|
||||||
#if defined(BOOST_HAS_PTHREADS)
|
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__)
|
||||||
|
|
||||||
pthread_setcancelstate( oldst, &oldst );
|
pthread_setcancelstate( oldst, &oldst );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user