Monitor.Pulse的目的

我只是想确保我在这里理解一些东西。 如果我使用Monitor.Enterlock获得锁定,我是否需要在释放锁之前调用Pulse

 Monitor.Enter Monitor.Pulse // Is that neccessary? Monitor.Exit 

我总是被认为Monitor.Exit调用会隐式调用Monitor.Pulse 。 这是真的吗?

我不确定你什么时候会使用Pulse 。 这就是造成混乱的原因。

不,您不需要调用Pulse …但是退出时也不会自动完成。

PulsePulseAllWait for signaling目的结合使用。

有关更多详细信息,请参阅本页的后半部分(忽略死锁位,基本上:)