Commit 207ad9fe authored by Philippe Gerum's avatar Philippe Gerum
Browse files

lib/thread: add unblock and demotion services

Starting with ABI 22, we can ask for the core to unblock a thread from
a wait state, which may include forcing it out of any real-time
scheduling class by demoting it to SCHED_WEAK in the same move.

Export evl_unblock_thread() and evl_demote_thread() as the
corresponding wrappers.
Signed-off-by: default avatarPhilippe Gerum <>
parent b2c2488d
......@@ -20,7 +20,7 @@
#include <evl/poll.h>
#include <evl/proxy.h>
#define __EVL__ 13 /* API version */
#define __EVL__ 14 /* API version */
#define EVL_ABI_PREREQ 21
......@@ -66,6 +66,10 @@ int evl_switch_inband(void);
int evl_get_state(int efd, struct evl_thread_state *statebuf);
int evl_unblock_thread(int efd);
int evl_demote_thread(int efd);
#ifdef __cplusplus
......@@ -197,12 +197,15 @@ int evl_switch_inband(void)
int evl_get_state(int efd, struct evl_thread_state *statebuf)
int ret;
return __evl_common_ioctl(efd, EVL_THRIOC_GET_STATE, statebuf);
if (evl_is_inband())
ret = ioctl(efd, EVL_THRIOC_GET_STATE, statebuf);
ret = oob_ioctl(efd, EVL_THRIOC_GET_STATE, statebuf);
int evl_unblock_thread(int efd)
return __evl_common_ioctl(efd, EVL_THRIOC_UNBLOCK);
return ret ? -errno : 0;
int evl_demote_thread(int efd)
return __evl_common_ioctl(efd, EVL_THRIOC_DEMOTE);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment