public class TTT {
public static void main (String [] args) {
X x = new X();
new Thread(new Waiter(x)).start();
new Thread(new Waiter(x)).start();
new Thread(new Notifier(x)).start();
}
}
class X {
synchronized void w() throws InterruptedException {
before(); wait(); after();
}
synchronized void n() { notifyAll(); }
void before() {}
void after() {}
}
class Waiter implements Runnable {
private X x;
public Waiter(X x) {
this.x = x;
}
@Override
public void run() {
try {
x.w();
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}
class Notifier implements Runnable {
private X x;
public Notifier(X x) {
this.x = x;
}
@Override
public void run() {
x.n();
}
}
分享到:
相关推荐
Advanced This example shows how to create a proxy server to redirect the calls to another server without having to recreate the RODL file, thus allowing the use of the same types of the original ...
New sample videos are shot with iPad (2017 model) with highest quality settings. Scene has more than 150K triangles (while shadows enabled). Transparent reflection support. Add extra reality to your ...
In the Integration Directory, define two communication channels: one for the File Adapter (to read the custom XML file from the FTP server) and another for the IDoc Adapter (to send the transformed ...
echo Usage: monitor.bat ServerIP PortNumber goto end 标签的名字可以随便起,但是最好是有意义的字母啦,字母前加个:用来表示这个字母是标签,goto命令就是根据这个:来寻找下一步跳到到那里。最好有一些说明...
1 , WinLocaleConvert.zip This program shows the international ... iusage.zip NO its not another internet usage monitor its different.Apart from calculating the cost and total time you spend on the ...
For each hypothesis generated, identify at least two other non-System Monitor pieces of information that would help to confirm or reject your hypothesis. Identify at least five counters for each...
RecordName,IP,Port,User,Password,Domain,ColorDepth,Updates,UnlockDesktop,Fullscreen,Nofullkbcontrol,Monitor,Sendrequest,Pbpath,Proxy,AsProxyBy,Memory,TreePath sample01,192.168.0.6,4899,user01,,,,,,,...
RecordName,IP,Port,User,Password,Domain,ColorDepth,Updates,UnlockDesktop,Fullscreen,Nofullkbcontrol,Monitor,Sendrequest,Pbpath,Proxy,AsProxyBy,Memory,TreePath sample01,192.168.0.6,4899,user01,,,,,,,...
Simple Structure Access 5.7.6 - Arrays of Structures 5.7.7 - Structures and Arrays as Fields of Another Structure 5.7.8 - Pointers to Structures and Arrays of Structure <br> 5.8 ...
PassMark BurnInTest V5.3 ...All Rights Reserved ... Overview ======== Passmark's BurnInTest is a software tool that allows all the major sub-systems of a computer to be simultaneously tested for reliability...
A resizer can contain another resizer... an so on. (you can divide you form in as many sizable sections as you want...).<END><br>13 , Label3D.zip This is a Label 3D user control that works like ...
Another way to say this is that the data itself is part of the clustered index. A clustered index keeps the data in a table ordered around the key. The data pages in the table are kept in a doubly ...
Radmin is a remote control program that lets you work on another computer remotely through your own. You see the remote computer's screen in a resizable window on your own monitor or as the full ...
- Monitor the installation process through the console output or by accessing the VNC connection if configured. #### CERTIFICATION OBJECTIVE 2.04: Administration with Secure Shell Remote ...
// We should also specify the relative monitor/camera response for proper gamma correction. CanvasFrame frame = new CanvasFrame("Some Title", CanvasFrame.getDefaultGamma()/grabber.getGamma()); // ...
You can use these functions to insert a file into the active file, insert a string into the file at every specified increment, sample colors from anywhere on your screen, and more. Using Bookmarks ...
1 A Sample gdb Session . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2 Getting In and Out of gdb . . . . . . . . . . . . . . . . . . . 11 2.1 Invoking gdb . . . . . . . . . . . . . . . . . . ....