diff --git a/Source/Tracking/Transaction.cs b/Source/Tracking/Transaction.cs index 51ea54d..3a4a1f3 100644 --- a/Source/Tracking/Transaction.cs +++ b/Source/Tracking/Transaction.cs @@ -128,7 +128,9 @@ namespace Nuclex.Support.Tracking { /// Waits until the background process finishes public virtual void Wait() { - WaitHandle.WaitOne(); + if(!this.ended) { + WaitHandle.WaitOne(); + } } #if !COMPACTFRAMEWORK @@ -141,6 +143,10 @@ namespace Nuclex.Support.Tracking { /// True if the background process completed, false if the timeout was reached /// public virtual bool Wait(TimeSpan timeout) { + if(this.ended) { + return true; + } + return WaitHandle.WaitOne(timeout, false); } @@ -154,6 +160,10 @@ namespace Nuclex.Support.Tracking { /// True if the background process completed, false if the timeout was reached /// public virtual bool Wait(int timeoutMilliseconds) { + if(this.ended) { + return true; + } + return WaitHandle.WaitOne(timeoutMilliseconds, false); }