googletest/googlemock/src
Abseil Team 8495449f07 Fix data race in leak detection
TSAN identified a data race between updates to the states_ map (ex. in Mock::UnregisterLocked) and the iteration done in this destructor. Writes to the map use g_gmock_mutex, but the destructor does not acquire it. Acquiring the lock here fixes the data race.

It should only be possible to trigger this TSAN finding in cases where a mock object is deleted by a thread other than the main thread.

PiperOrigin-RevId: 591935393
Change-Id: I9dd1faa40058d78e165a91333346514b4b73365c
2023-12-18 10:14:49 -08:00
..
gmock_main.cc Merge pull request #4302 from ciband:feat/nrf52 2023-07-18 08:16:57 -07:00
gmock-all.cc Comments changes, no functionality changes 2018-08-14 14:04:07 -04:00
gmock-cardinalities.cc Remove the legacy internal GTEST_DISALLOW_* macros 2022-04-22 11:26:03 -07:00
gmock-internal-utils.cc Add missing std includes 2023-04-20 14:29:09 -07:00
gmock-matchers.cc changed http to https 2023-08-22 20:58:34 +03:00
gmock-spec-builders.cc Fix data race in leak detection 2023-12-18 10:14:49 -08:00
gmock.cc Add missing std includes 2023-04-20 14:29:09 -07:00