mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
Add more TASK_CTL commands
This commit is contained in:
parent
ebcae85452
commit
0764b65dc4
@ -414,16 +414,6 @@ void rarch_task_push(rarch_task_t *task)
|
||||
impl_current->push_running(task);
|
||||
}
|
||||
|
||||
void rarch_task_wait(void)
|
||||
{
|
||||
impl_current->wait();
|
||||
}
|
||||
|
||||
void rarch_task_reset(void)
|
||||
{
|
||||
impl_current->reset();
|
||||
}
|
||||
|
||||
bool rarch_task_find(rarch_task_finder_t func, void *user_data)
|
||||
{
|
||||
return impl_current->find(func, user_data);
|
||||
@ -433,6 +423,12 @@ bool task_ctl(enum task_ctl_state state, void *data)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case TASK_CTL_RESET:
|
||||
impl_current->reset();
|
||||
break;
|
||||
case TASK_CTL_WAIT:
|
||||
impl_current->wait();
|
||||
break;
|
||||
case TASK_CTL_NONE:
|
||||
default:
|
||||
break;
|
||||
|
@ -27,7 +27,19 @@ extern "C" {
|
||||
|
||||
enum task_ctl_state
|
||||
{
|
||||
TASK_CTL_NONE = 0
|
||||
TASK_CTL_NONE = 0,
|
||||
|
||||
/* Blocks until all tasks have finished.
|
||||
* This must only be called from the main thread. */
|
||||
TASK_CTL_WAIT,
|
||||
|
||||
/* Sends a signal to terminate all the tasks.
|
||||
*
|
||||
* This won't terminate the tasks immediately.
|
||||
* They will finish as soon as possible.
|
||||
*
|
||||
* This must only be called from the main thread. */
|
||||
TASK_CTL_RESET,
|
||||
};
|
||||
|
||||
typedef struct rarch_task rarch_task_t;
|
||||
@ -98,23 +110,6 @@ void rarch_task_deinit(void);
|
||||
*/
|
||||
void rarch_task_check(void);
|
||||
|
||||
/**
|
||||
* @brief Sends a signal to terminate all the tasks.
|
||||
*
|
||||
* This function won't terminate the tasks immediately. They will finish as
|
||||
* soon as possible.
|
||||
*
|
||||
* This function must only be called from the main thread.
|
||||
*/
|
||||
void rarch_task_reset(void);
|
||||
|
||||
/**
|
||||
* @brief Blocks until all tasks have finished.
|
||||
*
|
||||
* This function must only be called from the main thread.
|
||||
*/
|
||||
void rarch_task_wait(void);
|
||||
|
||||
/**
|
||||
* @brief Calls func for every running task until it returns true.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user