diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-08-30 02:28:33 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-08-30 02:28:33 +0000 |
commit | c31b2ee9732f8d9a54e55e6138edd1d1748ddc0c (patch) | |
tree | fc8285abf4be821c8bf8f28fc0f899ab222afd85 /tests/Signal_Test.cpp | |
parent | 76a1d3250ada0bbb8165cde928d6f5a1dbcdfd12 (diff) | |
download | ATCD-c31b2ee9732f8d9a54e55e6138edd1d1748ddc0c.tar.gz |
ChangeLogTag:Sun Aug 29 07:53:33 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
Diffstat (limited to 'tests/Signal_Test.cpp')
-rw-r--r-- | tests/Signal_Test.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/tests/Signal_Test.cpp b/tests/Signal_Test.cpp index b5f192d4237..137befb885d 100644 --- a/tests/Signal_Test.cpp +++ b/tests/Signal_Test.cpp @@ -153,7 +153,7 @@ synchronous_signal_handler (void *) return 0; } -#if 1 // !defined (ACE_HAS_THREADS) +#if 0 // !defined (ACE_HAS_THREADS) // This function arranges to handle signals asynchronously, i.e., if // the platform lacks threads. @@ -230,23 +230,24 @@ worker_child (void *) static void run_test (ACE_THR_FUNC worker) { -#if 0 // defined (ACE_HAS_THREADS) - // Block all signals. - ACE_Sig_Set sigset (1); - int result = ACE_OS::thr_sigsetmask (SIG_BLOCK, - sigset, - 0); - ACE_ASSERT (result != -1); - - result = ACE_Thread_Manager::instance ()->spawn - (worker, 0, THR_DETACHED); - ACE_ASSERT (result != -1); +#if 1 // defined (ACE_HAS_THREADS) + int result; + { + // Block all signals before spawning the threads. Then, + // unblock these signals as the scope is exited. + ACE_Sig_Guard guard; + + result = ACE_Thread_Manager::instance ()->spawn + (worker, 0, THR_DETACHED); + ACE_ASSERT (result != -1); #if 0 - result = ACE_Thread_Manager::instance ()->spawn - (synchronous_signal_handler, 0, THR_DETACHED); - ACE_ASSERT (result != -1); + result = ACE_Thread_Manager::instance ()->spawn + (synchronous_signal_handler, 0, THR_DETACHED); + ACE_ASSERT (result != -1); + } #else + } synchronous_signal_handler (0); #endif /* 0 */ @@ -280,6 +281,7 @@ worker_parent (void *) // Perform a <wait> until our child process has exited. +#if 0 while (shut_down == 0) { // Wait for a signal to arrive. @@ -290,8 +292,9 @@ worker_parent (void *) ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P|%t) got signal!\n"))); } - // Note that <result> should == -1 because our signal handler should - // have "reaped" the SIGCHLD already. +#else + pm.wait (); +#endif ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P|%t) child done\n"))); |