linux下编程用 编译软件

源代码在线查看: thread_holdslock.java

软件大小: 49607 K
上传用户: IsABC
关键词: linux 编程 编译 软件
下载地址: 免注册下载 普通下载 VIP

相关代码

				// Test that Thread.holdsLock() works.								class Lock {}								public class Thread_HoldsLock				{				  static Lock lock = new Lock();				  				  public static void main(String args[]) throws InterruptedException				  {				    Thread_HoldsLock thl = new Thread_HoldsLock();				    				    thl.check();				    synchronized (lock)				      {				        thl.check();				      }				    thl.check();				  }				  				  public void check()				  {				    Thread this_thread = Thread.currentThread();				    System.out.println(this_thread.holdsLock(lock));				  }				}											

相关资源