From d827ee1d2a3766602b5a329fa078eebabadbc9ff Mon Sep 17 00:00:00 2001 From: caodongxia <315816521@qq.com> Date: Thu, 12 Aug 2021 14:22:40 +0800 Subject: [PATCH] Fix pthread_yield is deprecated (cherry picked from commit 2cb0f61c399fcbf29cbaf957eb83a09fe364c9d9) --- 0002-fix-pthread_yield.patch | 25 +++++++++++++++++++++++++ kae.spec | 6 +++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 0002-fix-pthread_yield.patch diff --git a/0002-fix-pthread_yield.patch b/0002-fix-pthread_yield.patch new file mode 100644 index 0000000..2dfe1d2 --- /dev/null +++ b/0002-fix-pthread_yield.patch @@ -0,0 +1,25 @@ +From f0c7130d9186dbb62367c0eb6c4d2ae6f78ef577 Mon Sep 17 00:00:00 2001 +From: caodongxia <315816521@qq.com> +Date: Thu, 12 Aug 2021 11:49:36 +0800 +Subject: [PATCH] pthread_yield is deprecated, use sched_yield instead + +--- + KAE/utils/engine_utils.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/KAE/utils/engine_utils.h b/KAE/utils/engine_utils.h +index 12a587e..f0b69b2 100644 +--- a/KAE/utils/engine_utils.h ++++ b/KAE/utils/engine_utils.h +@@ -129,7 +129,7 @@ static inline void kae_memcpy(void *src, const void *dst, int len) + + static inline void kae_pthread_yield() + { +- (void)pthread_yield(); //lint !e1055 ++ (void)sched_yield(); //lint !e1055 + } + + int kae_create_thread(pthread_t *thread_id, const pthread_attr_t *attr, +-- +2.27.0 + diff --git a/kae.spec b/kae.spec index a121b79..a14de2c 100644 --- a/kae.spec +++ b/kae.spec @@ -3,7 +3,7 @@ Name: libkae Summary: Huawei Kunpeng Accelerator Engine Version: 1.2.10 -Release: 4 +Release: 5 License: Apache-2.0 Source: %{name}-%{version}.tar.gz Vendor: Huawei Corporation @@ -18,6 +18,7 @@ Requires: openssl ExclusiveArch: aarch64 Patch0001: 0001-Don-t-redefine-gettid-if-glibc-provides-it.patch +Patch0002: 0002-fix-pthread_yield.patch %description This package contains the Huawei Kunpeng Accelerator Engine @@ -67,6 +68,9 @@ fi /sbin/ldconfig %changelog +* Thu Aug 12 2021 caodongxia 1.2.10-5 +- Fix pthread_yield is deprecated + * Tue Jul 28 2020 lingsheng 1.2.10-4 - Check glibc version to avoid redefine gettid() -- Gitee