Mercurial > pub > ImplabNet
comparison Implab/PromiseT.cs @ 130:671f60cd0250 v2
fixed Resove method bug when calling it on already cancelled promise
author | cin |
---|---|
date | Fri, 30 Jan 2015 17:07:17 +0300 |
parents | 2573b562e328 |
children | 656815cb7147 |
comparison
equal
deleted
inserted
replaced
129:471f596b2603 | 130:671f60cd0250 |
---|---|
300 } | 300 } |
301 | 301 |
302 T m_result; | 302 T m_result; |
303 | 303 |
304 public virtual void Resolve(T value) { | 304 public virtual void Resolve(T value) { |
305 BeginSetResult(); | 305 if (BeginSetResult()) { |
306 m_result = value; | 306 m_result = value; |
307 EndSetResult(); | 307 EndSetResult(); |
308 } | |
308 } | 309 } |
309 | 310 |
310 public void Reject(Exception error) { | 311 public void Reject(Exception error) { |
311 SetError(error); | 312 SetError(error); |
312 } | 313 } |