Java Thread wait() => blocked?

前端 未结 6 677
北荒
北荒 2020-12-28 09:55

According to Java thread state info calling wait() will result a thread to go in BLOCKED state. However this piece of code will result (after being called) in a Thread in WA

6条回答
  •  梦毁少年i
    2020-12-28 10:10

    There is some confusing terminology going on here. When a thread calls wait on an object it goes into the WAIT state. When threads are waiting to grab a lock, they belong to the wait set for that lock, but they are in the BLOCKED state.

    Confusing but somehow it makes sense!

提交回复
热议问题