diff Implab/Promise.cs @ 14:e943453e5039 promises

Implemented interllocked queue fixed promise syncronization
author cin
date Wed, 06 Nov 2013 17:49:12 +0400
parents 6ec82bf68c8e
children 0f982f9b7d4d
line wrap: on
line diff
--- a/Implab/Promise.cs	Wed Nov 06 01:07:55 2013 +0400
+++ b/Implab/Promise.cs	Wed Nov 06 17:49:12 2013 +0400
@@ -88,7 +88,7 @@
         /// <param name="result">Результат выполнения.</param>
         /// <exception cref="InvalidOperationException">Данное обещание уже выполнено</exception>
         public void Resolve(T result) {
-            lock (this) {
+            lock (m_lock) {
                 if (m_state == PromiseState.Cancelled)
                     return;
                 if (m_state != PromiseState.Unresolved)
@@ -106,7 +106,7 @@
         /// <param name="error">Исключение возникшее при выполнении операции</param>
         /// <exception cref="InvalidOperationException">Данное обещание уже выполнено</exception>
         public void Reject(Exception error) {
-            lock (this) {
+            lock (m_lock) {
                 if (m_state == PromiseState.Cancelled)
                     return;
                 if (m_state != PromiseState.Unresolved)