By requiring Release to be called with lock held. This is a bit of a kludge, but I think this works, because all known users of this deprecated class call Release either from OnWorkStop or SignalWorkDone, and both are called with the lock already held. Bug: webrtc:11567 Change-Id: Idf0007188e45a465aefcb8f13fea93a68930fe1c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204483 Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Markus Handell <handellm@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33188}