summaryrefslogtreecommitdiff
path: root/java/tests/Concurrency/TokenTest.java
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-23 23:16:39 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-23 23:16:39 +0000
commitb983862f8e9443fff2939eb6b629afe299837f75 (patch)
tree443b9d808e53debe85eb85cf78995d5fb45e8349 /java/tests/Concurrency/TokenTest.java
parent1ba527bb358117826342453bfb69ea96a9a4ce03 (diff)
downloadATCD-poa_end.tar.gz
This commit was manufactured by cvs2svn to create tag 'poa_end'.poa_end
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 ();
-}