Follow-up to https://github.com/dotnet/coreclr/pull/13298, missed a few cases.
{
Console.WriteLine("Waiting...");
int i = WaitHandle.WaitAny(
- new WaitHandle[]{myMutex, myMRE});
+ new WaitHandle[]{myMutex, myMRE}, 30000);
Console.WriteLine("WaitAny did not throw AbandonedMutexException. Result: {0}", i);
}
catch(AbandonedMutexException)
try
{
Console.WriteLine("Waiting...");
- int i = WaitHandle.WaitAny(wh, 5000);
- Console.WriteLine("WaitAny did not throw an exception");
+ int i = WaitHandle.WaitAny(wh, 30000);
+ Console.WriteLine("WaitAny did not throw AbandonedMutexException. Result: {0}", i);
}
catch(AbandonedMutexException)
{
private void AbandonOne()
{
- Mutex m = new Mutex();
foreach(WaitHandle w in wh)
{
- if(w.GetType() == m.GetType())
+ if(w is Mutex)
{
w.WaitOne();
break;
try
{
Console.WriteLine("Waiting...");
- int i = WaitHandle.WaitAny(wh);
- Console.WriteLine("WaitAny did not throw an exception");
+ int i = WaitHandle.WaitAny(wh, 30000);
+ Console.WriteLine("WaitAny did not throw AbandonedMutexException. Result: {0}", i);
}
catch(AbandonedMutexException)
{
private void AbandonOne()
{
- Mutex m = new Mutex();
foreach(WaitHandle w in wh)
{
- if(w.GetType() == m.GetType())
+ if(w is Mutex)
{
w.WaitOne();
break;