Possible Duplicate:
Lock (Monitor) internal implementation in .NET
I am wondering how Monitor.Enter() method works? I understand that each object allocated on heap has Sync Block structre associated with it. The SyncBlock structure contains feilds for Monitor, Hashcode, AppDomainID, thunking data for interoperating with com/unmanaged code. How does CLR handles multiple lock requests? If a lock is held by one thread (probably by increasing the Monitor field's value of SyncBlock data structure), other threads will go into WaitSleepJoin state. How does CLR handles threads in such state so that once lock is freed, only one thread will be resumed while other threads will contiue waiting for the lock? Does CLR create any WaitHandle object and puts threads to wait on the WaitHandle object?