summaryrefslogtreecommitdiff
path: root/java/tests/Concurrency/TokenTest.java
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-27 18:14:04 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-27 18:14:04 +0000
commit6c13de310492e31ede379bb04df1c62cbdb4b09f (patch)
treee97ae496cdcdecfec591b74ea60dde5ceb33d32a /java/tests/Concurrency/TokenTest.java
parentb5e068afb139dc7c6b9cf90c53571a4333105c95 (diff)
downloadATCD-pre_dynamic_any.tar.gz
This commit was manufactured by cvs2svn to create tagpre_dynamic_any
'pre_dynamic_any'.
Diffstat (limited to 'java/tests/Concurrency/TokenTest.java')
-rw-r--r--java/tests/Concurrency/TokenTest.java73
1 files changed, 0 insertions, 73 deletions
diff --git a/java/tests/Concurrency/TokenTest.java b/java/tests/Concurrency/TokenTest.java
deleted file mode 100644
index ededed9fed9..00000000000
--- a/java/tests/Concurrency/TokenTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * tests.Concurrency
- *
- * = FILENAME
- * TokenTest.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package tests.Concurrency;
-
-import java.io.*;
-import JACE.OS.*;
-import JACE.Concurrency.*;
-
-class MyToken extends Token
-{
- public void sleepHook ()
- {
- ACE.DEBUG (Thread.currentThread () + " blocking, sleepHook called");
- }
-}
-
-public class TokenTest implements Runnable
-{
- public void run ()
- {
- try
- {
- this.token_.acquire ();
- ACE.DEBUG (Thread.currentThread () + " acquired token");
- this.token_.acquire ();
- ACE.DEBUG (Thread.currentThread () + " acquired token");
- Thread.sleep (100);
-
- this.token_.renew (1);
-
- this.token_.release ();
- ACE.DEBUG (Thread.currentThread () + " released token");
- this.token_.release ();
- ACE.DEBUG (Thread.currentThread () + " released token");
- }
- catch (InterruptedException e)
- {
- this.token_.release ();
- }
- }
-
- public static void main (String args [])
- {
- ThreadManager tm = new ThreadManager ();
- int n = 1;
- try
- {
- if (args.length == 1)
- {
- n = Integer.parseInt (args[0]);
- }
- }
- catch (NumberFormatException e)
- {
- ACE.ERROR ("Illegal argument.");
- }
-
- tm.spawnN (n,
- new TokenTest (),
- false);
- }
-
- private MyToken token_ = new MyToken ();
-}