summaryrefslogtreecommitdiff
path: root/examples/Threads/test_process_mutex.cpp
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-11-12 21:39:32 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-11-12 21:39:32 +0000
commit6c8d74487fcf8c8418ff5205d0bc08dd99e1e34e (patch)
tree557e544d8274c8e0404d336c0e9b0e6cb36e7e72 /examples/Threads/test_process_mutex.cpp
parentadd7fcff0bc337851545e695aaf25c8c64b547b5 (diff)
downloadATCD-java-1_0_1a.tar.gz
This commit was manufactured by cvs2svn to create tag 'java-1_0_1a'.java-1_0_1a
Diffstat (limited to 'examples/Threads/test_process_mutex.cpp')
-rw-r--r--examples/Threads/test_process_mutex.cpp66
1 files changed, 0 insertions, 66 deletions
diff --git a/examples/Threads/test_process_mutex.cpp b/examples/Threads/test_process_mutex.cpp
deleted file mode 100644
index 35e5d26ad54..00000000000
--- a/examples/Threads/test_process_mutex.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-// This program tests ACE_Process_Mutexes. To run it, open 3
-// $Id$
-
-// or 4 windows and run this program in each window...
-
-#include "ace/Log_Msg.h"
-#include "ace/Synch.h"
-#include "ace/Signal.h"
-
-#if defined (ACE_HAS_THREADS)
-
-static sig_atomic_t done;
-
-static void
-handler (int)
-{
- done = 1;
-}
-
-int
-main (int argc, char *argv[])
-{
- char *name = argc == 1 ? "hello" : argv[1];
-
- ACE_Process_Mutex pm (name);
- ACE_Sig_Action handle ((ACE_SignalHandler) handler, SIGINT);
-
- for (int i = 0; i < 100 && !done; i++)
- {
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) = acquiring\n"));
- if (pm.acquire () == -1)
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) = %p\n", "acquire failed"));
- else
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) = acquired\n"));
-
- ACE_OS::sleep (3);
-
- if (pm.release () == -1)
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) = %p\n", "release failed"));
- else
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) = released\n"));
-
- if (pm.tryacquire () == -1)
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) = %p\n", "tryacquire failed"));
- else
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) = tryacquire\n"));
-
- if (pm.release () == -1)
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) = %p\n", "release failed"));
- else
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) = released\n"));
- }
-
- if (argc > 2)
- pm.remove ();
- return 0;
-}
-#else
-int
-main (void)
-{
- ACE_ERROR_RETURN ((LM_ERROR,
- "ACE doesn't support support threads on this platform (yet)\n"),
- -1);
-}
-#endif /* ACE_HAS_THREADS */