Not going to write a novel. just a snippet. Mayhaps will explain when I am sure I know what I am talking about.
private static void InlineThreadingWithLambda()
{
int local = 0;
var thread = new Thread(() =>
{
// just like javascript closures, you
// can take advantage of vars that are in
// scope right now. Same pitfalls as well.
local = 1;
});
thread.Start();
thread.Join();
Console.ReadLine();
}
Technorati tags:
C-Sharp,
CodeProject-Tip