use asynchronous worker termination

instead of waiting until all threads have joined, we are now supplying a callback that will be invoked once all threads have terminated. you can use this callback to free the worker struct
This commit is contained in:
Konstantin Käfer
2014-09-17 18:10:45 +02:00
parent 19129cbd02
commit daa22d6b0f
4 changed files with 109 additions and 40 deletions

View File

@@ -39,8 +39,9 @@ SQLiteStore::~SQLiteStore() {
// Nothing to do. This function needs to be here because we're forward-declaring
// Database, so we need the actual definition here to be able to properly destruct it.
if (worker) {
uv_worker_close(worker);
delete worker;
uv_worker_close(worker, [](uv_worker_t *worker) {
delete worker;
});
}
}