summaryrefslogtreecommitdiff
path: root/examples/Threads/process_mutex.cpp
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-09-24 01:23:45 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-09-24 01:23:45 +0000
commit971b5fef4c0790745d71d7493090c54af9fc3b60 (patch)
treeb9031b2eb4584c797d558a208156cb50296c257e /examples/Threads/process_mutex.cpp
parent39c67e8460275499ffcaf2ed95fe4df6cd157f28 (diff)
downloadATCD-pos_avsvc_split.tar.gz
This commit was manufactured by cvs2svn to create tagpos_avsvc_split
'pos_avsvc_split'.
Diffstat (limited to 'examples/Threads/process_mutex.cpp')
-rw-r--r--examples/Threads/process_mutex.cpp71
1 files changed, 0 insertions, 71 deletions
diff --git a/examples/Threads/process_mutex.cpp b/examples/Threads/process_mutex.cpp
deleted file mode 100644
index a500c4ce9b3..00000000000
--- a/examples/Threads/process_mutex.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-// $Id$
-
-// This program tests ACE_Process_Mutexes. To run it, open 3 or 4
-// windows and run this program in each window...
-
-#include "ace/Synch.h"
-#include "ace/Signal.h"
-
-ACE_RCSID(Threads, process_mutex, "$Id$")
-
-#if defined (ACE_HAS_THREADS)
-
-static sig_atomic_t done;
-
-extern "C" void
-handler (int)
-{
- done = 1;
-}
-
-int
-main (int argc, char *argv[])
-{
- const char *name = argc > 1 ? argv[1] : "hello";
- int iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : 100;
-
- ACE_Process_Mutex pm (name);
-
- // Register a signal handler.
- ACE_Sig_Action sa ((ACE_SignalHandler) handler, SIGINT);
- ACE_UNUSED_ARG (sa);
-
- for (int i = 0; i < iterations && !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 (int, char *[])
-{
- ACE_ERROR_RETURN ((LM_ERROR,
- "ACE doesn't support support threads on this platform (yet)\n"),
- -1);
-}
-#endif /* ACE_HAS_THREADS */