diff options
author | B. Stack <bgstack15@gmail.com> | 2023-01-22 13:56:55 -0500 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2023-01-22 13:56:55 -0500 |
commit | 75e05bc441382db69c842a64c562738cb749214e (patch) | |
tree | 698b60b3b4b914bf7958cf1174d0373909bf1e8f /zen/thread.h | |
parent | add upstream 11.29 (diff) | |
download | FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.tar.gz FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.tar.bz2 FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.zip |
add upstream 12.0
Diffstat (limited to 'zen/thread.h')
-rw-r--r-- | zen/thread.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/zen/thread.h b/zen/thread.h index 1823eefc..25a6463a 100644 --- a/zen/thread.h +++ b/zen/thread.h @@ -161,7 +161,7 @@ public: ~ThreadGroup() { for (InterruptibleThread& w : worker_) - w.requestStop(); //stop *all* at the same time before join! + w.requestStop(); //similar, but not the same as ~InterruptibleThread: stop *all* at the same time before join! if (detach_) //detach() without requestStop() doesn't make sense for (InterruptibleThread& w : worker_) @@ -190,13 +190,13 @@ public: void wait() { //perf: no difference in xBRZ test case compared to std::condition_variable-based implementation - auto promiseDone = std::make_shared<std::promise<void>>(); // - std::future<void> allDone = promiseDone->get_future(); + auto promDone = std::make_shared<std::promise<void>>(); // + std::future<void> futDone = promDone->get_future(); - notifyWhenDone([promiseDone] { promiseDone->set_value(); }); //std::function doesn't support construction involving move-only types! + notifyWhenDone([promDone] { promDone->set_value(); }); //std::function doesn't support construction involving move-only types! //use reference? => potential lifetime issue, e.g. promise object theoretically might be accessed inside set_value() after future gets signalled - allDone.get(); + futDone.get(); } //non-blocking wait()-alternative: context of controlling thread: |