DescriptionPAPI: Fix bug in RunWhileLocked, add support for params
This CL:
- Fixes a bug whereby a Callback bound by RunWhileLocked would release the lock before releasing bound values. This could lead to de-refing and possibly destroying objects (like Resources) that should only be manipulated with the ProxyLock held.
- Adds support for up to 3 parameters to RunWhileLocked. Should be easy to extend to more if/when we want.
- Adds a unit test that checks the bug and tests other utilities from ProxyLock.
There is still possibly a rare issue with the Callback being destroyed without being run, e.g. at process shutdown. I'm going to clean that up in a separate CL: https://codereview.chromium.org/19492014/
BUG=
R=bbudge@chromium.org, teravest@chromium.org, yzshen@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213693
Patch Set 1 : add the unit test #
Total comments: 6
Patch Set 2 : improve comment #Patch Set 3 : make CallOnMainThread lock #Patch Set 4 : other review comments + merge #Patch Set 5 : Remove ProxyLock::Get() (a.k.a. Sir Not-appearing-in-this-CL) #Patch Set 6 : Unlock when joining the audio thread so that we don't deadlock if it makes pepper calls. #
Messages
Total messages: 11 (0 generated)
|