Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RFC] Implement c10::Synchronized<T>, a basic error-avoiding synchron…
…ization wrapper for data (pytorch#73407) Summary: Pull Request resolved: pytorch#73407 After adding mutex/lock in a previous change, I realized that `folly::Synchronized<T>` exists for this reason. However, we can't use it, so I have implemented a basic version for use in `c10` in this change. Reviewers, please check if this looks reasonable as a minimal first step to enforce that data that is supposed to be used in a multi-threaded context ends up being locked before use. i.e. don't rely on the developer to do the right thing, instead enforce it using this abstraction. ghstack-source-id: 150327548 Test Plan: See the next diff in this stack for the text plan. Reviewed By: pavithranrao Differential Revision: D34465420 fbshipit-source-id: 76c921e9b78ff2dfc82a0bfc83ffc8fb232e2f21 (cherry picked from commit 5882fe2)
- Loading branch information