Added mutex protection for session_property_set_.

[ Cherry-pick of http://ag/19216679 ]
[ Merge of http://go/wvgerrit/155370 ]

There is a rare race condition experienced by some Android devices
where the a new client property set is being added while another is
being removed.  The C++ stl library does not provided thread
protection by default.

This CL adds a new mutex for the client property set map which prevents
multiple threads accessing the property sets concurrently.

Bug: 235238226
Test: GtsMediaTestCases on redfin
Change-Id: I32cf11bfb1332295ba1245071102ff0adc35259d
(cherry picked from commit aaa97a5d60)
This commit is contained in:
Alex Dale
2022-07-07 19:12:14 -07:00
parent 2dfc3171f7
commit dfcab07d14
3 changed files with 16 additions and 1 deletions

View File

@@ -142,6 +142,7 @@ class Properties {
static void InitOnce();
static std::mutex init_mutex_;
static std::mutex session_mutex_;
static bool is_initialized_;
static bool oem_crypto_use_secure_buffers_;
static bool oem_crypto_use_fifo_;