Add support for better "try-lock" pattern for Locker<Lock>. Maybe: ``` Locker locker { DeferLock, m_lock }; if (!locker.tryLock()) return; // Do something. ``` I think it would be nicer than the current: ``` if (!m_lock.tryLock()) return; Locker locker { AdoptLock, m_lock }; // Do something. ```
Created attachment 429536 [details] WIP Patch Very minimal patch for now as EWS didn't like it last time I tried this approach.
Created attachment 429537 [details] WIP Patch
Created attachment 429540 [details] WIP Patch (more complete)
Created attachment 429542 [details] WIP Patch (more complete)
Comment on attachment 429542 [details] WIP Patch (more complete) View in context: https://bugs.webkit.org/attachment.cgi?id=429542&action=review > Source/WebCore/Modules/speech/SpeechRecognitionCaptureSourceImpl.cpp:88 > + Locker locker { DeferLock, m_dataSourceLock }; ./Modules/speech/SpeechRecognitionCaptureSourceImpl.cpp:109:5: error: writing variable 'm_dataSource' requires holding mutex 'm_dataSourceLock' exclusively [-Werror,-Wthread-safety-analysis] EWS gets this error. I don't see what I am doing wrong here and this works fine locally :/
Add https://bugs.webkit.org/attachment.cgi?id=429537&action=prettypatch was building fine so the pattern seems to be working, at least in some cases..
<rdar://problem/78689398>