1.等待输入
new BufferedReader(new InputStreamReader(System.in)).readLine();
2.同步锁
synchronized (TopologyServiceServer.class) { while (true) { try { TopologyServiceServer.class.wait(); } catch (InterruptedException e) { // nothing to do. } } }
本文共 397 字,大约阅读时间需要 1 分钟。
1.等待输入
new BufferedReader(new InputStreamReader(System.in)).readLine();
2.同步锁
synchronized (TopologyServiceServer.class) { while (true) { try { TopologyServiceServer.class.wait(); } catch (InterruptedException e) { // nothing to do. } } }
转载于:https://my.oschina.net/mrpei123/blog/3024257