mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
fix: Moving SafeCriticalSection Enters outside of tryf block, don't want to Leave if the Enter fails
This commit is contained in:
parent
aae8bc5323
commit
602f170091
1 changed files with 4 additions and 2 deletions
|
|
@ -13,9 +13,10 @@ namespace ICD.Common.Utils
|
||||||
if (callback == null)
|
if (callback == null)
|
||||||
throw new ArgumentNullException("callback");
|
throw new ArgumentNullException("callback");
|
||||||
|
|
||||||
|
Enter();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Enter();
|
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|
@ -35,9 +36,10 @@ namespace ICD.Common.Utils
|
||||||
if (callback == null)
|
if (callback == null)
|
||||||
throw new ArgumentNullException("callback");
|
throw new ArgumentNullException("callback");
|
||||||
|
|
||||||
|
Enter();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Enter();
|
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue