> The code in question is pretty detailed, but the synchronization scheme
boils down to this: I have
> two overlapping (avoiding the word "interlocked") synchronized regions,
where I start, the first,
> start the second, exit the first, then exit the second, like this:
>
> object monitor1 = new object();
> object monitor2 = new object();
> lock (monitor1) {
> // ...
> lock (monitor2) {
> Monitor.Exit(monitor1);
> // ...
> }
> }
Jeff, I think the exception is thrown at the exit of the lock(monitor1)
block.
You are certainly aware that lock() { } is a shorthand for
try { Monitor.Enter() ...}finally { Monitor.Exit() }.
It follows that monitor1 is in fact exited twice, which apparently .net
endures silently while Mono does not.
You really should not mix lock() and Monitor.Enter/Exit.
HTH,
--Jonathan
===================================
This list is hosted by DevelopMentor� http://www.develop.com
NEW! ASP.NET courses you may be interested in:
2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet
Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet
View archives and manage your subscription(s) at http://discuss.develop.com