Bernhard Herzog wrote: > > > Basically yield and lock dont mix. > > That's definitely true. Even though it "works", it's still > a bad idea. > > Ok, so why is it a bad idea then (if it does what I want, at least in > MS.Net, doesn't it?). Actually I already removed my yield > code to avoid problems, but using yield would have been nice.
You are essentially exposing a locking API that the client (caller) doesn't know about and this makes it very deadlock prone. Also, since you don't control the lifetime of the lock, you have no idea how long the lock will be held, this is generally also not a very good idea. Regards, Jeroen _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
