1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-08-09 05:25:01 +00:00

Merge pull request #1037 from TomHarte/SaferShutdown

Reduce potential surprise in DeferringAsyncTaskQueue::flush.
This commit is contained in:
Thomas Harte
2022-06-02 12:56:51 -04:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -103,3 +103,8 @@ void DeferringAsyncTaskQueue::perform() {
} }
}); });
} }
void DeferringAsyncTaskQueue::flush() {
perform();
AsyncTaskQueue::flush();
}

View File

@@ -87,6 +87,11 @@ class DeferringAsyncTaskQueue: public AsyncTaskQueue {
*/ */
void perform(); void perform();
/*!
Blocks the caller until all previously-enqueud functions have completed.
*/
void flush();
private: private:
// TODO: this is a shared_ptr because of the issues capturing moveables in C++11; // TODO: this is a shared_ptr because of the issues capturing moveables in C++11;
// switch to a unique_ptr if/when adapting to C++14 // switch to a unique_ptr if/when adapting to C++14