mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
Update java-concurrent-questions-02.md
删除多余字符
This commit is contained in:
parent
9276ac2736
commit
d63f546e6b
@ -530,13 +530,13 @@ public class SynchronizedDemo {
|
||||
|
||||

|
||||
|
||||
对象锁的的拥有者线程才可以执行 `monitorexit` 指令来释放锁。在执行 `monitorexit` 指令后,将锁计数器设为 0,表明锁被释放,其他线程可以尝试获取锁。
|
||||
对象锁的拥有者线程才可以执行 `monitorexit` 指令来释放锁。在执行 `monitorexit` 指令后,将锁计数器设为 0,表明锁被释放,其他线程可以尝试获取锁。
|
||||
|
||||

|
||||
|
||||
如果获取对象锁失败,那当前线程就要阻塞等待,直到锁被另外一个线程释放为止。
|
||||
|
||||
#### synchronized 修饰方法的的情况
|
||||
#### synchronized 修饰方法的情况
|
||||
|
||||
```java
|
||||
public class SynchronizedDemo2 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user