I have `Parallel.ForEach` around some code, but it gives me different result than non-paraller code. So for diagnostic purposes I did wrap entire code using `lock` keyword:

```
var someArray = new double[123];
var syncObject = new Object();

Parallel.ForEach (windows, (win) =>
{
    lock (syncObject) // now it should execute sequentially?
    {
          // do something with someArray
    }
});

```

I thought lock will make it non-parallel, but I still get issues.
I thought it will be acting same as:

```
windows.ToList().ForEach ( (win) =>
{
    // do something with someArray
});

```

How it is possible that lock does not kills parallelism in this case?