Support AbandonedMutexException in RunOnce

This commit is contained in:
Kamil Trzciński 2022-12-12 18:32:28 +01:00
parent 10a8598b82
commit 288910316f

View file

@ -150,9 +150,16 @@ namespace CommonHelpers
{
runOnceMutex = TryCreateOrOpenExistingMutex(mutexName);
if (!runOnceMutex.WaitOne(runOnceTimeout))
try
{
Fatal(title, "Run many times");
if (!runOnceMutex.WaitOne(runOnceTimeout))
{
Fatal(title, "Run many times");
}
}
catch (AbandonedMutexException)
{
// it is still OK
}
}