【发布时间】:2012-04-28 11:25:30
【问题描述】:
可能重复:
What is the difference between a synchronized method and synchronized block in Java?
What is the difference between a synchronized function and synchronized block?
我不明白这两个线程代码之间的区别我相信它是为了互斥但我不明白有什么区别你能帮我吗?
public synchronized void Method1 () {
}
public myFunction (){
synchronized (this) {
}
}
感谢您的帮助。
【问题讨论】:
标签: java multithreading