diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-06-22 10:26:12 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-25 09:30:33 +0200 |
commit | 6ed59a76a0d1250059b8cdd61e0c3cf0f25b5a69 (patch) | |
tree | 248965d7519753bb0e23105a277166416e569398 /include/sched.h | |
parent | f866f471337e3249e0946764f09841baf73d6c9d (diff) | |
download | barebox-6ed59a76a0d1250059b8cdd61e0c3cf0f25b5a69.tar.gz barebox-6ed59a76a0d1250059b8cdd61e0c3cf0f25b5a69.tar.xz |
common: move workqueue handling from poller_call() to sched()
Workqueues are run out of poller_call, not because of a dependency, but
because when they were added, poller_call was directly called from
is_timeout.
With the addition of bthreads, there is now a general resched() function
that runs pollers and switches between bthreads. It makes sense to move
workqueue handling there as well to keep scheduling matter contained in
a single function. Do so.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210622082617.18011-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/sched.h')
-rw-r--r-- | include/sched.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/sched.h b/include/sched.h index 57be1678fd..4dadff2069 100644 --- a/include/sched.h +++ b/include/sched.h @@ -2,14 +2,12 @@ #ifndef __BAREBOX_SCHED_H_ #define __BAREBOX_SCHED_H_ -#include <bthread.h> -#include <poller.h> - +#ifdef CONFIG_HAS_SCHED +void resched(void); +#else static inline void resched(void) { - poller_call(); - if (!IS_ENABLED(CONFIG_POLLER) || !poller_active) - bthread_reschedule(); } +#endif #endif |