diff Implab/TaskController.cs @ 138:f75cfa58e3d4 v2

added ICancellable.Cancel(Exception) to allow specify the reason of cancellation
author cin
date Tue, 17 Feb 2015 18:16:26 +0300
parents c761fc982e1d
children
line wrap: on
line diff
--- a/Implab/TaskController.cs	Mon Feb 16 17:48:39 2015 +0300
+++ b/Implab/TaskController.cs	Tue Feb 17 18:16:26 2015 +0300
@@ -99,6 +99,13 @@
             }
         }
 
+        public void Cancel(Exception reason) {
+            lock (m_lock) {
+                if (!m_cancelled)
+                    m_cancelled = true;
+            }
+        }
+
         protected virtual void OnCancelled() {
             var temp = Cancelled;
             if (temp != null) {