Fix pthread_yield is deprecated

(cherry picked from commit 2cb0f61c399fcbf29cbaf957eb83a09fe364c9d9)
This commit is contained in:
caodongxia 2021-08-12 14:22:40 +08:00 committed by openeuler-sync-bot
parent d2fbe77bc3
commit d827ee1d2a
2 changed files with 30 additions and 1 deletions

View File

@ -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

View File

@ -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 <caodongxia@huawei.com> 1.2.10-5
- Fix pthread_yield is deprecated
* Tue Jul 28 2020 lingsheng <lingsheng@huawei.com> 1.2.10-4
- Check glibc version to avoid redefine gettid()