diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-01 08:00:34 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-01 08:00:34 +0000 |
commit | d9661aebab28abc0ec4fb1e716170d347d56c168 (patch) | |
tree | ecb671ab4b8e299bf5cbb8b2dfeed8a49b65fc06 /examples/Misc/test_trace.cpp | |
parent | ea0d28240863caf437a18071bfd03e7b146c5ade (diff) | |
download | ATCD-unlabeled-4.3.2.tar.gz |
This commit was manufactured by cvs2svn to create branchunlabeled-4.3.2
'unlabeled-4.3.2'.
Diffstat (limited to 'examples/Misc/test_trace.cpp')
-rw-r--r-- | examples/Misc/test_trace.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/examples/Misc/test_trace.cpp b/examples/Misc/test_trace.cpp deleted file mode 100644 index 41b407cbdca..00000000000 --- a/examples/Misc/test_trace.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Enable tracing -// $Id$ - -#define ACE_NTRACE 0 - -#include "ace/Thread.h" -#include "ace/Signal.h" - -static void -foo (int max_depth) -{ - ACE_Trace _ ("void foo (void)", __LINE__, __FILE__); - - if (max_depth > 0) - foo (max_depth - 1); - // Destructor automatically called. -} - -int -main (int argc, char *argv[]) -{ - const int MAX_DEPTH = argc == 1 ? 10 : atoi (argv[1]); - - if (argc > 2) - ACE_Trace::set_nesting_indent (ACE_OS::atoi (argv[2])); - - ACE_Trace _ ("int main (int argc, char *argv[])", __LINE__, __FILE__); - - // The following won't work on MVS OpenEdition... - ACE_Sig_Action sig1 ((ACE_SignalHandler) ACE_Trace::start_tracing, SIGUSR1); - ACE_Sig_Action sig2 ((ACE_SignalHandler) ACE_Trace::stop_tracing, SIGUSR2); - -#if defined (ACE_MT_SAFE) - int n_threads = argc > 3 ? ACE_OS::atoi (argv[3]) : 4; - - if (ACE_Thread::spawn_n (n_threads, ACE_THR_FUNC (foo), - (void *) MAX_DEPTH, - THR_BOUND | THR_DETACHED) != n_threads) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "spawn_n"), -1); - ACE_OS::thr_exit (0); -#else - for (;;) - foo (MAX_DEPTH); -#endif /* ACE_MT_SAFE */ - - // Destructor automatically called. - return 0; -} - |