Added mutex protection for session_property_set_.
[ Merge of http://go/wvgerrit/154575 ] [ Cherry-pick of http://ag/19498242 ] 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 commitaaa97a5d60) (cherry picked from commit6109ec6d66)
This commit is contained in:
@@ -52,7 +52,10 @@ void Properties::InitOnce() {
|
||||
allow_restore_of_offline_licenses_with_release_ =
|
||||
kAllowRestoreOfflineLicenseWithRelease;
|
||||
delay_oem_crypto_termination_ = kPropertyDelayOemCryptoTermination;
|
||||
session_property_set_.reset(new CdmClientPropertySetMap());
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(session_mutex_);
|
||||
session_property_set_.reset(new CdmClientPropertySetMap());
|
||||
}
|
||||
}
|
||||
|
||||
bool Properties::GetCompanyName(std::string* company_name) {
|
||||
|
||||
Reference in New Issue
Block a user