mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 17:49:29 +01:00
http: Correct new thread executor.
It needs to be able to handle N new threads, oops.
This commit is contained in:
1 parent
e97e3c4218
commit
bf83bb1e47
2 files changed
+6
-4
No files matched your search
@@ -10,13 +10,14 @@ void SameThreadExecutor::Run(std::function<void()> func) {
|
||||
}
|
||||
|
||||
void NewThreadExecutor::Run(std::function<void()> func) {
|
||||
thread_ = std::thread(func);
|
||||
threads_.push_back(std::thread(func));
|
||||
}
|
||||
|
||||
NewThreadExecutor::~NewThreadExecutor() {
|
||||
// If Run was ever called...
|
||||
if (thread_.joinable())
|
||||
thread_.join();
|
||||
for (auto &thread : threads_)
|
||||
thread.join();
|
||||
threads_.clear();
|
||||
}
|
||||
|
||||
} // namespace threading
|
||||
Reference in new issue
Block a user