From: Stephen Toub Date: Fri, 8 May 2020 00:58:18 +0000 (-0400) Subject: Remove unnecessary recursive locking from Http2Stream.Complete (#36030) X-Git-Tag: submit/tizen/20210909.063632~8106 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17cff47fea6f36d68e4388a8b6986ae6cb129279;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Remove unnecessary recursive locking from Http2Stream.Complete (#36030) We just asserted we're holding the lock. We don't need to take it again. --- diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs index 2948820..6c66a67 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs @@ -329,14 +329,11 @@ namespace System.Net.Http _connection.RemoveStream(this); - lock (SyncObject) + CreditWaiter? w = _creditWaiter; + if (w != null) { - CreditWaiter? w = _creditWaiter; - if (w != null) - { - w.Dispose(); - _creditWaiter = null; - } + w.Dispose(); + _creditWaiter = null; } }