summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/CoordinatorBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test/CoordinatorBase.cs')
-rw-r--r--src/DotNetOpenAuth.Test/CoordinatorBase.cs14
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();
+ }
}
}
}