Mercurial > pub > ImplabNet
diff Implab/Parallels/AsyncPool.cs @ 40:fe33f4e02ad5
improved tracing
added text listeners (file,console)
author | cin |
---|---|
date | Tue, 15 Apr 2014 17:52:09 +0400 |
parents | 313f708a50e9 |
children | d10034588e38 |
line wrap: on
line diff
--- a/Implab/Parallels/AsyncPool.cs Tue Apr 15 02:46:53 2014 +0400 +++ b/Implab/Parallels/AsyncPool.cs Tue Apr 15 17:52:09 2014 +0400 @@ -14,10 +14,10 @@ public static Promise<T> Invoke<T>(Func<T> func) { var p = new Promise<T>(); - var caller = TraceContext.Current; + var caller = TraceContext.Snapshot(); ThreadPool.QueueUserWorkItem(param => { - TraceLog.Transfer(caller); + TraceContext.Transfer(caller); try { p.Resolve(func()); } catch(Exception e) { @@ -31,10 +31,10 @@ public static Promise<T> InvokeNewThread<T>(Func<T> func) { var p = new Promise<T>(); - var caller = TraceContext.Current; + var caller = TraceContext.Snapshot(); var worker = new Thread(() => { - TraceLog.Transfer(caller); + TraceContext.Transfer(caller); try { p.Resolve(func()); } catch (Exception e) {