boolean held = Thread.currentThread().holdsLock(lock); System.out.println(held);
Thread this_thread = Thread.currentThread(); System.out.println(this_thread.holdsLock(lock));
  public void check()  {    boolean held = Thread.currentThread().holdsLock(lock);    System.out.println(held);  }