CodePudding user response:
Sleep method is thread dormancy, yield the CPU, not releasing the lockWait method is thread waiting, releases the lock
CodePudding user response:
Essence is different, the wait is Object, the method of sleep is the method of Thread; Wait don't need to catch exceptions, sleep must catch exceptions; Wait only in a synchronous control method or synchronous control block used inside, sleep can be used in any place,CodePudding user response:
Sleep is dormant, time available to lockWait wait, need to interrupt to acquire the lock
CodePudding user response:
https://blog.csdn.net/weixin_48502062/article/details/108610035CodePudding user response:
HENHAOCodePudding user response:
??????????