Skip to content
Snippets Groups Projects
Commit e000e270 authored by Florian Fischer's avatar Florian Fischer
Browse files

[Dispatcher] replace deprecated pthread_yield with sched_yield

Compilation with gcc on ubuntu 21.10 fails because pthread_yield is
apparently deprecated and should be replaced with sched_yield.

gcc --version
gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0
parent 90d32eab
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Copyright © 2020 Florian Schmaus // Copyright © 2020 Florian Schmaus
#include "Dispatcher.hpp" #include "Dispatcher.hpp"
#include <pthread.h> // for pthread_yield #include <sched.h>
#include "Emper.hpp" #include "Emper.hpp"
#include "Runtime.hpp" // for Runtime #include "Runtime.hpp" // for Runtime
...@@ -17,6 +17,6 @@ void Dispatcher::dispatchLoopDoSleep() { ...@@ -17,6 +17,6 @@ void Dispatcher::dispatchLoopDoSleep() {
if constexpr (emper::WORKER_SLEEP) { if constexpr (emper::WORKER_SLEEP) {
runtime.dispatchLoopSleep(); runtime.dispatchLoopSleep();
} else { } else {
pthread_yield(); sched_yield();
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment