diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/CoordinatorBase.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/CoordinatorBase.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/DotNetOpenAuth.Test/CoordinatorBase.cs b/src/DotNetOpenAuth.Test/CoordinatorBase.cs index 4463dde..8efd46d 100644 --- a/src/DotNetOpenAuth.Test/CoordinatorBase.cs +++ b/src/DotNetOpenAuth.Test/CoordinatorBase.cs @@ -39,12 +39,14 @@ namespace DotNetOpenAuth.Test { action(); } catch (Exception ex) { // We may be the second thread in an ThreadAbortException, so check the "flag" - if (failingException == null) { - failingException = ex; - if (Thread.CurrentThread == party1Thread) { - party2Thread.Abort(); - } else { - party1Thread.Abort(); + lock (this) { + if (failingException == null || (failingException is ThreadAbortException && !(ex is ThreadAbortException))) { + failingException = ex; + if (Thread.CurrentThread == party1Thread) { + party2Thread.Abort(); + } else { + party1Thread.Abort(); + } } } } |