Avoid race conditions between periodic timer and close sessions

am: 5b169b1722

Change-Id: Ibd7d1f58e4ba17dd29baee1a788193ffd17aa7c6
This commit is contained in:
Rahul Frias
2018-05-04 09:19:43 -07:00
committed by android-build-merger

View File

@@ -72,6 +72,7 @@ CdmResponseType WvContentDecryptionModule::CloseSession(
CdmEngine* cdm_engine = GetCdmForSessionId(session_id);
// TODO(rfrias): Avoid reusing the error codes from CdmEngine.
if (!cdm_engine) return SESSION_NOT_FOUND_1;
AutoLock auto_lock(cdms_lock_);
CdmResponseType sts = cdm_engine->CloseSession(session_id);
cdm_engine->GetMetrics()->cdm_engine_close_session_.Increment(sts);
if (sts == NO_ERROR) {