From 9a3febf848cc9e94bc3c36d7384a77ab0a05c217 Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Tue, 7 Jan 2025 21:13:58 -0500 Subject: [PATCH] OpenHarmony doesn't support pthread_setcancelstate. --- include/boost/core/detail/sp_thread_sleep.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/core/detail/sp_thread_sleep.hpp b/include/boost/core/detail/sp_thread_sleep.hpp index f461c3f..bb5b1e0 100644 --- a/include/boost/core/detail/sp_thread_sleep.hpp +++ b/include/boost/core/detail/sp_thread_sleep.hpp @@ -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 );