# HG changeset patch # User cin # Date 2014-04-10 00:20:25 # Node ID dabf79fde388d19cd5b762a3dc4a37541f226344 # Parent b255e4aeef1757bf4f600c61579fef621f0887c5 fixed race condition in DispatchPool diff --git a/Implab.Test/AsyncTests.cs b/Implab.Test/AsyncTests.cs --- a/Implab.Test/AsyncTests.cs +++ b/Implab.Test/AsyncTests.cs @@ -244,7 +244,7 @@ namespace Implab.Test { [TestMethod] public void ChainedMapTest() { - using (var pool = new WorkerPool(0,100,0)) { + using (var pool = new WorkerPool(0,100,100)) { int count = 10000; double[] args = new double[count]; diff --git a/Implab.suo b/Implab.suo index 7d0dced8f9843cdcbf2e228d319a32e165d49e3c..2551c242a8fc7c93912d4e7a7aa20b99c6d0d1d9 GIT binary patch literal 71168 zc%1D$4R{pQwKqT@K#(5+5w%8&K1FufO*Xq50)=EZfoOohhCne0vztj+*kt4GCJ;nx z)#|hUQK`1tDk%O{tSC~&ze=ehSRQDVR$FVWtxs!Pi&c2kDtYJJJF`1GncbP$zhuMS zd?$BicIKY@d+s^so_o)0hep45?-LXML}cL`WFR@wJ(LWVJR1OzC*F)=_X7b=ba!`) zk1qr0&V{TAUjYn)Hai0#A7BUow)s$i0)Pm5`Z&>zVbDQ&ju(0I0s-7z}EpL1Dp$R9>9MAoDXmTz!ZQB0j2^N z0E__B0Ez+302Y8U00%%RfEB<7UvyAsxE@+9 zNY+4mdLa%$+XkT>0^#RDm2@VP0eLtE^x#JtS`fzXg?6l?ID1UcB^nL9sfuV#PN@HD2{)8Z>;279RElkL>hqf1;_tc z0D8uMxsayP_{T1Uldzn z1~HD94#LL2n8&q}>-EC*1|c2+9q<;oz6#(64^BC{$KaX&)RY5`n;xqDP^Ihi2uB=4 z^?ni^a4=xU6&Z^{?46f31f9IQqoppu2l=)T7xMbs>Nw9Du7#gk)W8RVa6i**GSa`P zMUD<%s3XA7Y~wpZ0nRtIsIJ59^Lj4kyXyUG__mpDQ%Q4av#r@|ZYni#CESoa5i^EC z9rL`NfIsMO4jCJ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gvW z^Dpt$F9c%L24LQ>P`ia$BEHaPHE|MWSUXA+M#NF8h*q zQ)VTiXI$%bT0_VPqUWSZE78YML{8C^TG=aksAe{fsTd9Yng5E64>Y^iv*$spZgYsv z`BKeuJlnh5KS$=uq}x^tRZIW)*Vjk2nk5l(hA!HYh|6ClqU$-=H{RYBJPTUSejhC+ zV(gS^eOec7hA)JiNeDgJDpB56OlOepa%6+!d5(Lpx!yZVmM0D{RsA@K!s`ua<9E-#2S|Uo7Fsgs6!UU!u%?4$nych_}6i z(7g)>`?P#3)g3J&J+-A6u8HwH7qUO(^lv%+TVJM6IsIE|^>6y;+t?=*MCRHty5)@q zS_i2Ah%E`?&Z^sbfi9>~K(vV6(Z_q4QV+nLB>QCf&c3s2a%WxT&brE-b(PFnS2?e6 z>R#bylAb$?Q?JR0?c*(bd}x_dT2rz83{6inp4e?+ND{M}zamRU`kIKXEJGyP`uUsd`Is5W@>c8BiyrhZH`o82RW@Xm2lvYno7wT$}oZqEn#*3QYrED!% z&I?gCmM*pzqIA&&HJ?J6m>slx2+DCTIS)ZO4?(G!5po_P`r}NP)0*eB<~gmoUJnuJ zOSv~{QT_Z^_47~XK#cw*(Visk%R)e3TE~QIb^O}S{}Y22{K%PTJ%81rzW*@~PyL)n zw3i>x-uqHBe%14rbnpMeygnTL$U8ggw&$Vp*sIU!@p^hKIZkG~2l+aEy3R$5Z9Cbw z?H2or-CFu>#QK|kR&G>h|7nMWOd|Sr=|uJo`Y1OPl 0 + // continue + if (m_queueLength > 0) + return true; + return base.Suspend(); + } + protected override void InvokeUnit(Action unit) { unit(); }