summaryrefslogtreecommitdiffstats
path: root/include/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sched.h')
-rw-r--r--include/sched.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/sched.h b/include/sched.h
new file mode 100644
index 0000000000..57be1678fd
--- /dev/null
+++ b/include/sched.h
@@ -0,0 +1,15 @@
+/* SPDX License Identifier: GPL-2.0 */
+#ifndef __BAREBOX_SCHED_H_
+#define __BAREBOX_SCHED_H_
+
+#include <bthread.h>
+#include <poller.h>
+
+static inline void resched(void)
+{
+ poller_call();
+ if (!IS_ENABLED(CONFIG_POLLER) || !poller_active)
+ bthread_reschedule();
+}
+
+#endif