1.
synchronized void method () {
.....
}
2.
void emthod () {
synchronized (this) {
....
}
}
3.
class Something {
static synchronized void method () {
...
}
}
4.
class Something {
static void method () {
synchronized (something.class) {
...
}
}
}
'Development > Programming' 카테고리의 다른 글
[Java Design Patten] Single Threaded Execution (0) | 2014.05.20 |
---|---|
[Java] wait, notify, notifyAll (0) | 2014.05.16 |
[Java] 패키지 탐색하기~! (0) | 2014.04.17 |
[Scala] Named Parameters (0) | 2014.04.15 |
[Java] Class Method 접근 및 사용 (0) | 2014.04.09 |