Commit 0954f3eb by Bryce McKinlay Committed by Bryce McKinlay

Thread_HoldsLock.java: New test case.

2004-07-27  Bryce McKinlay  <mckinlay@redhat.com>

	* testsuite/libjava.lang/Thread_HoldsLock.java: New test case.
	* testsuite/libjava.lang/Thread_HoldsLock.out: New.

From-SVN: r85234
parent e140e27d
2004-07-27 Bryce McKinlay <mckinlay@redhat.com>
* testsuite/libjava.lang/Thread_HoldsLock.java: New test case.
* testsuite/libjava.lang/Thread_HoldsLock.out: New.
2004-07-27 Bryce McKinlay <mckinlay@redhat.com>
* java/io/File.java (toURI): Throw RuntimeException, not
InternalError.
* java/lang/Runtime.java (exit): Qualify static sleep() call with
......
// 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()
{
boolean held = Thread.currentThread().holdsLock(lock);
System.out.println(held);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment