summaryrefslogtreecommitdiff
path: root/java/tests/Concurrency/TokenTest.java
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-01 08:00:34 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-01 08:00:34 +0000
commit437eea6fa08e931864f89be91d14a816f69075c7 (patch)
treeb8c1fd723fdcd61c3855d3a3a21a9cd45a268219 /java/tests/Concurrency/TokenTest.java
parentea0d28240863caf437a18071bfd03e7b146c5ade (diff)
downloadATCD-unlabeled-4.2.2.tar.gz
This commit was manufactured by cvs2svn to create branchunlabeled-4.2.2
'unlabeled-4.2.2'.
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 a9b435d171d..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 ACE.OS.*;
-import ACE.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 (0);
-
- 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 ();
-}