mirror of
https://github.com/libretro/RetroArch
synced 2024-12-27 15:29:23 +00:00
only wait for save task to complete
This commit is contained in:
parent
5ebce6a238
commit
9aa42c9d5e
@ -51,8 +51,8 @@ bool content_load_state(const char* path, bool load_to_backup_buffer, bool autol
|
|||||||
/* Save a state from memory to disk. */
|
/* Save a state from memory to disk. */
|
||||||
bool content_save_state(const char *path, bool save_to_disk, bool autosave);
|
bool content_save_state(const char *path, bool save_to_disk, bool autosave);
|
||||||
|
|
||||||
/* Returns true if a save state task is in progress */
|
/* Waits for any in-progress save state tasks to finish */
|
||||||
bool content_save_state_in_progress(void);
|
void content_wait_for_save_state_task(void);
|
||||||
|
|
||||||
/* Copy a save state. */
|
/* Copy a save state. */
|
||||||
bool content_rename_state(const char *origin, const char *dest);
|
bool content_rename_state(const char *origin, const char *dest);
|
||||||
|
@ -235,7 +235,7 @@ static void retro_task_regular_gather(void)
|
|||||||
|
|
||||||
static void retro_task_regular_wait(retro_task_condition_fn_t cond, void* data)
|
static void retro_task_regular_wait(retro_task_condition_fn_t cond, void* data)
|
||||||
{
|
{
|
||||||
while (tasks_running.front && (!cond || cond(data)))
|
while ((tasks_running.front && !tasks_running.front->when) && (!cond || cond(data)))
|
||||||
retro_task_regular_gather();
|
retro_task_regular_gather();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,10 +420,9 @@ static void retro_task_threaded_wait(retro_task_condition_fn_t cond, void* data)
|
|||||||
retro_task_threaded_gather();
|
retro_task_threaded_gather();
|
||||||
|
|
||||||
slock_lock(running_lock);
|
slock_lock(running_lock);
|
||||||
wait = (tasks_running.front) &&
|
wait = (tasks_running.front && !tasks_running.front->when);
|
||||||
(!cond || cond(data));
|
|
||||||
slock_unlock(running_lock);
|
slock_unlock(running_lock);
|
||||||
} while (wait);
|
} while (wait && (!cond || cond(data)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void retro_task_threaded_reset(void)
|
static void retro_task_threaded_reset(void)
|
||||||
|
@ -37605,8 +37605,7 @@ bool retroarch_main_quit(void)
|
|||||||
/* If any save states are in progress, wait
|
/* If any save states are in progress, wait
|
||||||
* until all tasks are complete (otherwise
|
* until all tasks are complete (otherwise
|
||||||
* save state file may be truncated) */
|
* save state file may be truncated) */
|
||||||
if (content_save_state_in_progress())
|
content_wait_for_save_state_task();
|
||||||
task_queue_wait(NULL, NULL);
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIGFILE
|
#ifdef HAVE_CONFIGFILE
|
||||||
if (p_rarch->runloop_overrides_active)
|
if (p_rarch->runloop_overrides_active)
|
||||||
|
@ -1372,7 +1372,7 @@ static bool task_save_state_finder(retro_task_t *task, void *user_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Returns true if a save state task is in progress */
|
/* Returns true if a save state task is in progress */
|
||||||
bool content_save_state_in_progress(void)
|
static bool content_save_state_in_progress(void* data)
|
||||||
{
|
{
|
||||||
task_finder_data_t find_data;
|
task_finder_data_t find_data;
|
||||||
|
|
||||||
@ -1385,6 +1385,11 @@ bool content_save_state_in_progress(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void content_wait_for_save_state_task(void)
|
||||||
|
{
|
||||||
|
task_queue_wait(content_save_state_in_progress, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* content_load_state:
|
* content_load_state:
|
||||||
* @path : path that state will be loaded from.
|
* @path : path that state will be loaded from.
|
||||||
|
Loading…
Reference in New Issue
Block a user