diff Implab/AbstractEvent.cs @ 248:5cb4826c2c2a v3

Added awaiters to promises Added static methods to Promise Resolve, Reject, All. Updated promise helpers
author cin
date Tue, 30 Jan 2018 01:37:17 +0300
parents eee3e49dd1ff
children 34df34841225
line wrap: on
line diff
--- a/Implab/AbstractEvent.cs	Fri Jan 26 18:46:27 2018 +0300
+++ b/Implab/AbstractEvent.cs	Tue Jan 30 01:37:17 2018 +0300
@@ -69,7 +69,7 @@
 
         protected void WaitTransition() {
             if (m_state == TransitionalState) {
-                SpinWait spin;
+                SpinWait spin = new SpinWait();
                 do {
                     spin.SpinOnce();
                 } while (m_state == TransitionalState);
@@ -87,17 +87,6 @@
 
         #endregion
 
-        protected abstract Signal GetFulfillSignal();
-
-        #region synchronization traits
-        protected void WaitResult(int timeout) {
-            if (!(IsResolved || GetFulfillSignal().Wait(timeout)))
-                throw new TimeoutException();
-        }
-
-
-        #endregion
-
         #region handlers managment
 
         protected void AddHandler(THandler handler) {