c# - Parallel.For loop does not execute code after finished -


after parallel.for loop finished code below loop not executed. return statement not going executed if i'll set breakpoint program not reach it. have ideas why?

thank you

c canvas way.

here code:

        parallel.for(0, playfield.last().field.getlength(0), x =>          {             parallel.for(0, playfield.last().field.getlength(1), y =>             {                 if (playfield.last().field[x, y] == 1)                     {                         c.children.add(createrectangle(lengthx, lengthy, x, y));                     }             });         });          return c; 

you exception on "c.children.add" because it's trying add controls crossthreaded. thats not allowed in wpf.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -