auto commit

This commit is contained in:
CyC2018
2018-12-08 16:10:36 +08:00
parent f636f9c8bf
commit 1a478a905f
5 changed files with 12 additions and 62 deletions

View File

@ -632,7 +632,7 @@ B
它们都属于 Object 的一部分,而不属于 Thread。
只能用在同步方法或者同步控制块中使用,否则会在运行时抛出 IllegalMonitorStateException。
只能用在同步方法或者同步控制块中使用,否则会在运行时抛出 IllegalMonitorStateExeception。
使用 wait() 挂起期间,线程会释放锁。这是因为,如果没有释放锁,那么其它线程就无法进入对象的同步方法或者同步控制块中,那么就无法执行 notify() 或者 notifyAll() 来唤醒挂起的线程,造成死锁。