parent
0d3f5be95b
commit
5b90113d86
|
@ -250,24 +250,24 @@ namespace Kernel
|
||||||
/**
|
/**
|
||||||
* Prevent thread from participating in CPU scheduling
|
* Prevent thread from participating in CPU scheduling
|
||||||
*
|
*
|
||||||
* \param id ID of the targeted thread. If not set
|
* \param thread_id kernel name of the targeted thread or 0
|
||||||
* this will target the current thread.
|
|
||||||
*
|
*
|
||||||
* \retval 0 succeeded
|
* \retval 0 succeeded
|
||||||
* \retval -1 the targeted thread does not exist or is still active
|
* \retval -1 the targeted thread does not exist or is still active
|
||||||
*
|
*
|
||||||
* If the caller doesn't target itself, this is restricted to core threads.
|
* If thread_id is set to 0 the caller targets itself. If the caller
|
||||||
|
* doesn't target itself, the call is restricted to core threads.
|
||||||
*/
|
*/
|
||||||
inline int pause_thread(unsigned const id = 0)
|
inline int pause_thread(unsigned const thread_id)
|
||||||
{
|
{
|
||||||
return call(Call_id::PAUSE_THREAD, id);
|
return call(Call_id::PAUSE_THREAD, thread_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Let an already started thread participate in CPU scheduling
|
* Let an already started thread participate in CPU scheduling
|
||||||
*
|
*
|
||||||
* \param id ID of the targeted thread
|
* \param thread_id kernel name of the targeted thread
|
||||||
*
|
*
|
||||||
* \retval 0 succeeded and thread was paused beforehand
|
* \retval 0 succeeded and thread was paused beforehand
|
||||||
* \retval 1 succeeded and thread was active beforehand
|
* \retval 1 succeeded and thread was active beforehand
|
||||||
|
@ -276,21 +276,23 @@ namespace Kernel
|
||||||
* If the targeted thread blocks for any event except a 'start_thread'
|
* If the targeted thread blocks for any event except a 'start_thread'
|
||||||
* call this call cancels the blocking.
|
* call this call cancels the blocking.
|
||||||
*/
|
*/
|
||||||
inline int resume_thread(unsigned const id = 0)
|
inline int resume_thread(unsigned const thread_id)
|
||||||
{
|
{
|
||||||
return call(Call_id::RESUME_THREAD, id);
|
return call(Call_id::RESUME_THREAD, thread_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Let the current thread give up its remaining timeslice
|
* Let the current thread give up its remaining timeslice
|
||||||
*
|
*
|
||||||
* \param id if this thread ID is set and valid this will resume the
|
* \param thread_id kernel name of the benefited thread
|
||||||
* targeted thread additionally
|
*
|
||||||
|
* If thread_id is valid the call will resume the targeted thread
|
||||||
|
* additionally.
|
||||||
*/
|
*/
|
||||||
inline void yield_thread(unsigned const id = 0)
|
inline void yield_thread(unsigned const thread_id)
|
||||||
{
|
{
|
||||||
call(Call_id::YIELD_THREAD, id);
|
call(Call_id::YIELD_THREAD, thread_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ Ipc_ostream::Ipc_ostream(Native_capability dst, Msgbuf_base *snd_msg)
|
||||||
void Ipc_istream::_wait()
|
void Ipc_istream::_wait()
|
||||||
{
|
{
|
||||||
/* FIXME: this shall be not supported */
|
/* FIXME: this shall be not supported */
|
||||||
Kernel::pause_thread();
|
Kernel::pause_thread(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ extern Genode::Native_thread_id _main_thread_id;
|
||||||
/**
|
/**
|
||||||
* Yield execution time-slice of current thread
|
* Yield execution time-slice of current thread
|
||||||
*/
|
*/
|
||||||
static inline void thread_yield() { Kernel::yield_thread(); }
|
static inline void thread_yield() { Kernel::yield_thread(0); }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,7 +59,7 @@ thread_check_stopped_and_restart(Genode::Thread_base * const t)
|
||||||
/**
|
/**
|
||||||
* Pause execution of current thread
|
* Pause execution of current thread
|
||||||
*/
|
*/
|
||||||
static inline void thread_stop_myself() { Kernel::pause_thread(); }
|
static inline void thread_stop_myself() { Kernel::pause_thread(0); }
|
||||||
|
|
||||||
|
|
||||||
#endif /* _LOCK_HELPER_H_ */
|
#endif /* _LOCK_HELPER_H_ */
|
||||||
|
|
|
@ -107,7 +107,10 @@ namespace Genode {
|
||||||
|
|
||||||
inline Rom_fs *rom_fs() { return &_rom_fs; }
|
inline Rom_fs *rom_fs() { return &_rom_fs; }
|
||||||
|
|
||||||
inline void wait_for_exit() { while (1) Kernel::pause_thread(); };
|
inline void wait_for_exit()
|
||||||
|
{
|
||||||
|
while (1) { Kernel::pause_thread(0); }
|
||||||
|
};
|
||||||
|
|
||||||
bool supports_direct_unmap() const { return 1; }
|
bool supports_direct_unmap() const { return 1; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user