java wait阻塞_java – 当一个线程在wait()上阻塞时被中断时会发生什么?

The thread T is then removed from the wait set for this object and

re-enabled for thread scheduling. It then competes in the usual manner

with other threads for the right to synchronize on the object; once it

has gained control of the object, all its synchronization claims on

the object are restored to the status quo ante – that is, to the

situation as of the time that the wait method was invoked. Thread T

then returns from the invocation of the wait method. Thus, on return

from the wait method, the synchronization state of the object and of

thread T is exactly as it was when the wait method was invoked.

If the current thread is interrupted by another thread while it is waiting, then an InterruptedException is thrown. This exception is not thrown until the lock status of this object has been restored as described above.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值