java monitor

来源:互联网 发布:龙珠人物战斗力数据 编辑:程序博客网 时间:2024/05/16 01:15

A monitor is like a building that contains one special room that can be occupied by only one thread at a time. The room usually contains some data. From the time a thread enters this room to the time it leaves, it has exclusive access to any data in the room. Entering the monitor building is called "entering the monitor." Entering the special room inside the building is called "acquiring the monitor." Occupying the room is called "owning the monitor," and leaving the room is called "releasing the monitor." Leaving the entire building is called "exiting the monitor."

 

 

http://docs.oracle.com/javase/tutorial/essential/concurrency/guardmeth.html

原创粉丝点击