summaryrefslogtreecommitdiffstats
path: root/libjava
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-27 22:04:37 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-27 22:04:37 +0000
commit27a14593342960077817415ec457cdf87c2974e1 (patch)
treec675c6cf3221f84f52a69a61f7d80575322f7651 /libjava
parent33dd998bc0c0b03ecae84d722c102e5bafc2e66d (diff)
downloadppe42-gcc-27a14593342960077817415ec457cdf87c2974e1.tar.gz
ppe42-gcc-27a14593342960077817415ec457cdf87c2974e1.zip
2004-07-27 Bryce McKinlay <mckinlay@redhat.com>
* testsuite/libjava.lang/Thread_HoldsLock.java: New test case. * testsuite/libjava.lang/Thread_HoldsLock.out: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85234 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/testsuite/libjava.lang/Thread_HoldsLock.java27
-rw-r--r--libjava/testsuite/libjava.lang/Thread_HoldsLock.out3
3 files changed, 35 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index ce46e07bdf6..2ad34fae6e4 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,10 @@
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
diff --git a/libjava/testsuite/libjava.lang/Thread_HoldsLock.java b/libjava/testsuite/libjava.lang/Thread_HoldsLock.java
new file mode 100644
index 00000000000..3a46466cb13
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Thread_HoldsLock.java
@@ -0,0 +1,27 @@
+// 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);
+ }
+}
+
diff --git a/libjava/testsuite/libjava.lang/Thread_HoldsLock.out b/libjava/testsuite/libjava.lang/Thread_HoldsLock.out
new file mode 100644
index 00000000000..eed403754b0
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Thread_HoldsLock.out
@@ -0,0 +1,3 @@
+false
+true
+false
OpenPOWER on IntegriCloud