diff --git a/libretro-common/include/queues/task_queue.h b/libretro-common/include/queues/task_queue.h index 25930f7f67..5910c15dd6 100644 --- a/libretro-common/include/queues/task_queue.h +++ b/libretro-common/include/queues/task_queue.h @@ -175,16 +175,41 @@ void task_queue_unset_threaded(void); bool task_queue_is_threaded(void); +/** + * Calls func for every running task + * until it returns true. + * Returns a task or NULL if not found. + */ bool task_queue_find(task_finder_data_t *find_data); +/** + * Calls func for every running task when handler + * parameter matches task handler, allowing the + * list parameter to be filled with user-defined + * data. + */ void task_queue_retrieve(task_retriever_data_t *data); + /* Checks for finished tasks + * Takes the finished tasks, if any, + * and runs their callbacks. + * This must only be called from the main thread. */ void task_queue_check(void); +/* Pushes a task + * The task will start as soon as possible. */ void task_queue_push(retro_task_t *task); +/* Blocks until all tasks have finished. + * This must only be called from the main thread. */ void task_queue_wait(void); +/* 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. */ void task_queue_reset(void); /* Deinitializes the task system.