mirror of
https://github.com/JesseTG/melonds-ds.git
synced 2024-11-28 01:00:33 +00:00
Split up retro::task::deinit into wait and reset
This commit is contained in:
parent
f4a9887e79
commit
0dc65bf435
@ -440,6 +440,8 @@ PUBLIC_SYMBOL void retro_unload_game(void) {
|
||||
// No need to flush the homebrew save data either, the CartHomebrew destructor does that
|
||||
|
||||
// The cleanup handlers for each task will flush data to disk if needed
|
||||
retro::task::reset();
|
||||
retro::task::wait();
|
||||
retro::task::deinit();
|
||||
|
||||
if (NDS::Running)
|
||||
|
@ -44,13 +44,21 @@ void retro::task::push(TaskSpec&& task) noexcept {
|
||||
task._task = nullptr;
|
||||
}
|
||||
|
||||
void retro::task::wait() noexcept {
|
||||
ZoneScopedN("retro::task::wait");
|
||||
task_queue_wait(nullptr, nullptr); // wait for all tasks to finish
|
||||
}
|
||||
|
||||
void retro::task::deinit() noexcept {
|
||||
ZoneScopedN("retro::task::deinit");
|
||||
task_queue_reset(); // cancel all outstanding tasks
|
||||
task_queue_wait(nullptr, nullptr); // wait for all tasks to finish
|
||||
task_queue_deinit();
|
||||
}
|
||||
|
||||
void retro::task::reset() noexcept {
|
||||
ZoneScopedN("retro::task::reset");
|
||||
task_queue_reset(); // cancel all outstanding tasks
|
||||
}
|
||||
|
||||
void retro::task::check() noexcept {
|
||||
ZoneScopedN("retro::task::check");
|
||||
task_queue_check();
|
||||
|
@ -35,7 +35,9 @@ namespace retro::task {
|
||||
|
||||
void push(TaskSpec&& task) noexcept;
|
||||
void check() noexcept;
|
||||
void reset() noexcept;
|
||||
void deinit() noexcept;
|
||||
void wait() noexcept;
|
||||
|
||||
class TaskSpec {
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user