Condition give the effect of having multiple wait-sets per object?

后端 未结 3 512
悲哀的现实
悲哀的现实 2021-01-07 10:28

I am reading about Condition in java.util.concurrent.locks.Condition .

Condition factors out the Object monitor methods (wait, notify and

3条回答
  •  遥遥无期
    2021-01-07 10:59

    For a bounded DataStructure for example, you can have the Conditions "notEmpty" and "notFull" and wait for them. Just one example. Have a look at the example here.

提交回复
热议问题