Merge pull request #187 from eagleoflqj/ohos

OpenHarmony doesn't support pthread_setcancelstate.
This commit is contained in:
Peter Dimov 2025-01-08 16:45:11 +02:00 committed by GitHub
commit 7178a52909
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,7 +67,7 @@ namespace core
inline void sp_thread_sleep() BOOST_NOEXCEPT
{
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__)
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__) && !defined(__OHOS__)
int oldst;
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &oldst );
@ -85,7 +85,7 @@ inline void sp_thread_sleep() BOOST_NOEXCEPT
nanosleep( &rqtp, 0 );
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__)
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__) && !defined(__OHOS__)
pthread_setcancelstate( oldst, &oldst );