Fix race condition in DataFetcherSharedMemoryBase
A race condition can occur when a polling thread tries to obtain a pointer to the shared memory via a std::map, while that map is modified by the main thread. This patch implements a fix such that the polling thread does not have direct access to the std::map where the shared memory pointers are stored. Instead the pointer is passed as an argument of the Start() method. This patch fixes the DataFetcherSharedMemoryBaseTest.DoesPollMotionAndOrientation test on linux tsan. BUG=284959 Review URL: https://chromiumcodereview.appspot.com/23441047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221404 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment