Posts: 9
Joined: May 2022
Reputation:
0
@"glenguy" I was looking at the source code, for fun.. It looks to me like there's plenty of potental for thread timing issues. In cdm_adapter.cc, what calls CdmAdapter::SetTimer? If SetTimer and CloseSession are called around the same time, it could easily end up calling cdm11_->TimerExpired after cdm11->CloseSession.
Posts: 57
Joined: Apr 2016
Reputation:
6
Thanks for having a look over it. A far as I know and can see SetTimer is called by the CDM itself. But only after we call TimerExpired on the CDM i.e - if you don't do anything on SetTimer being called, then it will only ever be called the one time.
timerfunc is supposed to check the flag that's set when we want to close the session - if the flag is true then don't call TimerExpired so CDM will not try to call back, therefore theoretically avoiding a situation leading to crash. But please correct me if you think otherwise.
I'm no expert in thread safety so if you have any more insight I'd be grateful.