diff --git a/Implab.v11.suo b/Implab.v11.suo index c3b0d3f668f7a93b548d7c4a3825707ecbef4da9..2499e7be2058885bde9009de32d2756ec4238c87 GIT binary patch literal 103936 zc%1D$33waD)uY^p1LPn;xD134z*1yemhBuRwrnRMPGVvw1P~;$yml1JlF*UF!4wEL zG(btAK!Jvv0tG_(DbNBb6n^frwD3bID4I znw>XqjyG@KG5hK(li$B-=ZrrRMfeUGNxtnLPsT`|jet0k-|Rz38N2_szrP?~0AE=diN4@iBYhJO;#`GfbQ42r}k_}`D zK<|W9BiU>a{s`H4)AP=igbrUC+K7ilNH=LFKDb87D)=uzo%r*JMp-k-2+RH?G3NEa zzXamAID8)oK`S842&;ntZQ+Ig4G=eya$+aPrY!524DkO}lCKov9=IPZ!2y5Yhut5{ z@?)3|>G2Q`WxpK(*L{gd7iK`jb|`_kH^gZWk#^vixDVof5D$Pj3F0b^ILak%~$#D^gM9OA+2BTkjxVdzk~a?Aik}5j^RCc_6PPH7v2w8`cEo(wZbRx&i}FZK7;G$5Wi5A zldjCcr2p@?pSug`e=XkRj{aK^HqsZo>Url@l3)6N3n?7>FMZcRL|V+p3ttoPekMzE z`d>wo=^m&5n4ZS2oc?2)(|?}-NR=|miTWII@oUz{tv5ch&Ofr#tM9Eetk zHinB6u1Fu|L7We90YToDkmDdOgjff$9-<3k1H?v%O+*}?iyL1Cx^(m=i*gn{G1 zTKFIxP$|pK=>G(wpZ-hf-wJ>i1b3K-U)z0{GaJM&KjAKAWX+FQSM4!#z_v{%<>6e*p1nlHjk9cfS_mbr639 z@p{Q`7Ir5P?*TaYG_a@<1H~SjjmZS_*ec?$iPBaW6T;0DQV0vh;}**AA$` zCfH|U8;DTD0Jnwy7J$1B;0eO;OAn;wt>OgubBM9|hde+DOSjPyqq2G+WIsUbrF02@ zP2Bu5CKZScIz3_ia#5GC}{0dU51>Z3KzlV6K zPWY8{H~Cl32P`f!m$-rd2vYjv zrrejG@*f=#krxS4E~J~(k&Te@K%Q30vBlza*-h3$eK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B7&f%}*Y<10o*T`?2c; z-{h-DukX0q*6e(!gd|w;H({;#>&V1?N^V#R9t-7PP`5EpNd;>h+J1SD?bolJI{8ZB zqd)%WLgWI}_n+Kq#=!nt)jjT6%TPIMVdvMQOTT&j^eeBw=iwQb&))u1Y13i4OL`wa zVk6)Bmt3@eVfaq_zutD~aep{w$6gyADV_S+d&`vV-zm9Ih%}2`|8&~G9)oj0jb-bW zk2d}2ZoB7@(x&T6q>XyyfrLySm$=VJev}_?BGdl2Q0#xd84&-UQA6JU=d|4UQ{N$imtD61CAFQ*i^k@5^plmd$LwVG1MI>;l==2}{V2KpP)?Mj+oKh?^{Yf7&V z!wX|XS<)zSM@D`X#qR%;m0yS_9QO3WzSwQ-!bhcO#6xK?I(@SS?e`ITaaY5efpXI0hPMR}k%+iNTPPlsaoBw?B{rm19L}eLN z(VrUd|45izr~e2-=jxI-@BLu*(btWwx#790uHUOxg$L9BFgyRlB>yvm>hxmwKg+lO zShn^rrvF!Q`+r?sF#a#{FLgY&@-Mz`P96W~n9_ev{`tj^eXK@=aR5A!xB6%PHJEwJ zuDy^-0U;Qr^j8@O`QOVJ7g0x&K}N zZrAv%`Y>Dj#o_M%S?u>|*wt|VlJ$RocjcFrJ(n7l%_Z%Bb;z7$qHc5lJNW0PNaWWTvXNg)`QJ=r lv%{SKC7l1wRDL~m*Ugvh*y<_0 /// Создает постоянную копию текущего контекста, данную копию можно хранить и использовать для передачи через /// - /// Копия текущего контекста трассировки или null если таковой не был создан. + /// Копия текущего контекста трассировки. public static TraceContext Snapshot() { - return _current == null ? null : new TraceContext(_current); + return _current == null ? new TraceContext() : new TraceContext(_current); } /// diff --git a/Implab/Parallels/ArrayTraits.cs b/Implab/Parallels/ArrayTraits.cs --- a/Implab/Parallels/ArrayTraits.cs +++ b/Implab/Parallels/ArrayTraits.cs @@ -1,4 +1,5 @@ -using System; +using Implab.Diagnostics; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -11,6 +12,7 @@ namespace Implab.Parallels { readonly Action m_action; readonly TSrc[] m_source; readonly Promise m_promise = new Promise(); + readonly TraceContext m_traceContext; int m_pending; int m_next; @@ -21,6 +23,7 @@ namespace Implab.Parallels { Debug.Assert(source != null); Debug.Assert(action != null); + m_traceContext = TraceContext.Snapshot(); m_next = 0; m_source = source; m_pending = source.Length; @@ -38,6 +41,11 @@ namespace Implab.Parallels { } } + protected override void Worker() { + TraceContext.Transfer(m_traceContext); + base.Worker(); + } + protected override bool TryDequeue(out int unit) { unit = Interlocked.Increment(ref m_next) - 1; return unit >= m_source.Length ? false : true; @@ -60,6 +68,7 @@ namespace Implab.Parallels { readonly TSrc[] m_source; readonly TDst[] m_dest; readonly Promise m_promise = new Promise(); + readonly TraceContext m_traceContext; int m_pending; int m_next; @@ -75,6 +84,7 @@ namespace Implab.Parallels { m_dest = new TDst[source.Length]; m_pending = source.Length; m_transform = transform; + m_traceContext = TraceContext.Snapshot(); m_promise.Anyway(() => Dispose()); m_promise.Cancelled(() => Dispose()); @@ -88,6 +98,11 @@ namespace Implab.Parallels { } } + protected override void Worker() { + TraceContext.Transfer(m_traceContext); + base.Worker(); + } + protected override bool TryDequeue(out int unit) { unit = Interlocked.Increment(ref m_next) - 1; return unit >= m_source.Length ? false : true; diff --git a/Implab/Parallels/DispatchPool.cs b/Implab/Parallels/DispatchPool.cs --- a/Implab/Parallels/DispatchPool.cs +++ b/Implab/Parallels/DispatchPool.cs @@ -274,7 +274,7 @@ namespace Implab.Parallels { protected abstract void InvokeUnit(TUnit unit); - void Worker() { + protected virtual void Worker() { TUnit unit; //Console.WriteLine("{0}: Active", Thread.CurrentThread.ManagedThreadId); Interlocked.Increment(ref m_activeThreads);