Skip to content

Commit 595dd65

Browse files
committed
Fix lock misuse
1 parent 822ab2d commit 595dd65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CollapseLauncher/XAMLs/MainApp/MainWindow.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ public sealed partial class MainWindow : Window
3737
{
3838
private static bool _isForceDisableIntro;
3939

40-
private static readonly Lock CriticalOpLock = new Lock();
40+
private static readonly Lock CriticalOpLock = new();
4141
public static bool IsCriticalOpInProgress
4242
{
4343
get;
4444
set
4545
{
46-
lock (CriticalOpLock)
46+
using (CriticalOpLock.EnterScope())
4747
{
4848
var lastValue = field;
4949
field = value;

0 commit comments

Comments
 (0)