This is an automated email from the ASF dual-hosted git repository.
andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 188256f1e porting/npl/linux: Replace pthread_yield() with sched_yield()
188256f1e is described below
commit 188256f1ef27737b5d6ca13d754f22a1062b2744
Author: Deomid "rojer" Ryabkov <[email protected]>
AuthorDate: Wed Jul 19 21:39:23 2023 +0100
porting/npl/linux: Replace pthread_yield() with sched_yield()
Per `pthread_yield(3)`:
```
This call is nonstandard, but present on several other systems.
Use the standardized sched_yield(2) instead.
```
---
porting/npl/linux/src/os_task.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/porting/npl/linux/src/os_task.c b/porting/npl/linux/src/os_task.c
index fe6c2df11..b03deb066 100644
--- a/porting/npl/linux/src/os_task.c
+++ b/porting/npl/linux/src/os_task.c
@@ -17,6 +17,8 @@
* under the License.
*/
+#include <sched.h>
+
#include "os/os.h"
#include "nimble/nimble_npl.h"
@@ -106,7 +108,7 @@ bool ble_npl_os_started(void)
void ble_npl_task_yield(void)
{
- pthread_yield();
+ sched_yield();
}
#ifdef __cplusplus