I am aware that you can lock an object in c# using lock but can you give up the lock and wait for something else to notify you that it’s changed like you can in java with wait and notify?
It seems to me that synchronised and lock in java and c# respectively are synonomous.
The equivalent functionality (including the normal locking) is in the Monitor class.
The
lockstatement in C# is equivalent to callingMonitor.EnterandMonitor.Exitwith an appropriate try/finally block.See my threading tutorial or Joe Albahari’s one for more details.