aboutsummaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.lang/Thread_Monitor.java
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2016-09-30 16:24:48 +0000
committerAndrew Haley <aph@gcc.gnu.org>2016-09-30 16:24:48 +0000
commit07b78716af6a9d7c9fd1e94d9baf94a52c873947 (patch)
tree3f22b3241c513ad168c8353805614ae1249410f4 /libjava/testsuite/libjava.lang/Thread_Monitor.java
parenteae993948bae8b788c53772bcb9217c063716f93 (diff)
downloadgcc-07b78716af6a9d7c9fd1e94d9baf94a52c873947.zip
gcc-07b78716af6a9d7c9fd1e94d9baf94a52c873947.tar.gz
gcc-07b78716af6a9d7c9fd1e94d9baf94a52c873947.tar.bz2
Makefile.def: Remove libjava.
2016-09-30 Andrew Haley <aph@redhat.com> * Makefile.def: Remove libjava. * Makefile.tpl: Likewise. * Makefile.in: Regenerate. * configure.ac: Likewise. * configure: Likewise. * gcc/java: Remove. * libjava: Likewise. From-SVN: r240662
Diffstat (limited to 'libjava/testsuite/libjava.lang/Thread_Monitor.java')
-rw-r--r--libjava/testsuite/libjava.lang/Thread_Monitor.java64
1 files changed, 0 insertions, 64 deletions
diff --git a/libjava/testsuite/libjava.lang/Thread_Monitor.java b/libjava/testsuite/libjava.lang/Thread_Monitor.java
deleted file mode 100644
index 649a75c..0000000
--- a/libjava/testsuite/libjava.lang/Thread_Monitor.java
+++ /dev/null
@@ -1,64 +0,0 @@
-// Test that monitor locks work and are recursive.
-
-class T implements Runnable
-{
- public int count = 0;
- Counter c;
-
- public T (Counter c)
- {
- this.c = c;
- }
-
- public void run()
- {
- while (true)
- {
- // NOTE: double-synchronization here.
- synchronized (c)
- {
- if (c.getCount() <= 100000)
- count++;
- else
- break;
- }
- }
- }
-}
-
-class Counter
-{
- int i = 0;
- public synchronized int getCount ()
- {
- return ++i;
- }
-}
-
-public class Thread_Monitor
-{
- public static void main(String args[])
- {
- Counter c = new Counter();
- T t1 = new T(c);
- T t2 = new T(c);
-
- Thread th1 = new Thread(t1);
- Thread th2 = new Thread(t2);
- th1.start();
- th2.start();
- try
- {
- th1.join();
- th2.join();
- }
- catch (InterruptedException x)
- {
- System.out.println("failed: Interrupted");
- }
- if (t1.count + t2.count == 100000)
- System.out.println ("ok");
- else
- System.out.println ("failed: total count incorrect");
- }
-}