diff Implab/AbstractEvent.cs @ 148:e6d4b41f0101 v2

fixed timeout handling in promises
author cin
date Wed, 15 Apr 2015 07:30:20 +0300
parents 706fccb85524
children 97fbbf816844
line wrap: on
line diff
--- a/Implab/AbstractEvent.cs	Tue Mar 17 08:25:35 2015 +0300
+++ b/Implab/AbstractEvent.cs	Wed Apr 15 07:30:20 2015 +0300
@@ -172,8 +172,8 @@
 
         #region synchronization traits
         protected void WaitResult(int timeout) {
-            if (!IsResolved)
-                GetResolveSignal().Wait(timeout);
+            if (!(IsResolved || GetResolveSignal().Wait(timeout)))
+                throw new TimeoutException();
 
             switch (m_state) {
                 case SUCCEEDED_STATE: