summaryrefslogtreecommitdiff
path: root/src/envfs.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-04-17 10:23:10 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2020-04-17 10:23:10 -0400
commit47867d427f46a8478aa0107738adab1bfbfc7c56 (patch)
tree174c4d40dcbfe1a3ce741ad045ec7d03c8d1174c /src/envfs.h
parentf43c11497df6550ac224e0965b7a07d4c548055b (diff)
fixed crash when switching to an instance with a lower refresh thread count
fixed rare race condition when waking up handle closer threads
Diffstat (limited to 'src/envfs.h')
-rw-r--r--src/envfs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/envfs.h b/src/envfs.h
index 8790b071..bbc27005 100644
--- a/src/envfs.h
+++ b/src/envfs.h
@@ -128,6 +128,15 @@ private:
thread = std::thread([&]{ run(); });
}
+ ~ThreadInfo()
+ {
+ if (thread.joinable()) {
+ stop = true;
+ wakeup();
+ thread.join();
+ }
+ }
+
void wakeup()
{
{