Mercurial > pub > ImplabNet
diff Implab/Parallels/WorkerPool.cs @ 40:fe33f4e02ad5
improved tracing
added text listeners (file,console)
author | cin |
---|---|
date | Tue, 15 Apr 2014 17:52:09 +0400 |
parents | 313f708a50e9 |
children | 4f20870d0816 |
line wrap: on
line diff
--- a/Implab/Parallels/WorkerPool.cs Tue Apr 15 02:46:53 2014 +0400 +++ b/Implab/Parallels/WorkerPool.cs Tue Apr 15 17:52:09 2014 +0400 @@ -42,15 +42,16 @@ var promise = new Promise<T>(); - var caller = TraceContext.Current; + var caller = TraceContext.Snapshot(); EnqueueTask(delegate() { - TraceLog.Transfer(caller); - try { - promise.Resolve(task()); - } catch (Exception e) { - promise.Reject(e); - } + caller.Invoke(delegate() { + try { + promise.Resolve(task()); + } catch (Exception e) { + promise.Reject(e); + } + }); }); return promise;