void Abortee5( ) { try { int a = gNum / gDenom; } catch (ArithmeticException) { Console.WriteLine("__05:Got arithmetic exception"); try { AbortStart.Set( ); Console.WriteLine("__05:waiting for someone to abort"); AbortSent.WaitOne( ); Console.WriteLine("__05:waiting some more to make sure we are not interrupted"); for (int i = 0; i < 3; i++) { Delay(5000); Console.Write("5"); } Console.WriteLine( ); Console.WriteLine("__05:Done"); } catch (Exception) { Console.WriteLine("__05:Should get here"); } Console.WriteLine("__05:ResetingAbort to defeat the abort"); Thread.ResetAbort( ); } Console.WriteLine("__05:Should see this after calling Thread.ResetAbort( )"); }
void Abortee6( ) { try { int a = gNum / gDenom; } catch (ArithmeticException) { Console.WriteLine("__06:Got arithmetic exception"); try { AbortStart.Set( ); Console.WriteLine("__06:waiting for someone to abort"); AbortSent.WaitOne( ); Console.WriteLine("__06:waiting some more to make sure we are not interrupted"); for (int i = 0; i < 3; i++) { Delay(1000); Console.Write("6"); } Console.WriteLine( ); Console.WriteLine("__06:Done"); } catch (ArithmeticException) { Console.WriteLine("%_06:Should not get here"); retCode = 6; } } Console.WriteLine("%_06:Should not see this "); retCode = 6; }