mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Add a comment about the shared_ptr<atomic>
This commit is contained in:
1 parent
f0411ff6f4
commit
597e2bc6c0
1 file changed
+4
@@ -22,6 +22,10 @@ private:
|
||||
struct Worker {
|
||||
std::thread thread;
|
||||
// Set by the worker as its last act, read by whoever calls Run() next.
|
||||
// It does look a bit fragile with the atomic inside a shared_ptr, but the way
|
||||
// this is used, it should be fine. The atomic is only used to signal that the thread
|
||||
// is done, and the shared_ptr is only used to keep the atomic alive until
|
||||
// the thread is joined.
|
||||
std::shared_ptr<std::atomic<bool>> done;
|
||||
};
|
||||
std::vector<Worker> workers_;
|
||||
|
||||
Reference in new issue
Block a user