diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-08-30 02:11:28 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-08-30 02:11:28 +0000 |
commit | 73c00c60fbd26053ecec42943288257f632ad0b1 (patch) | |
tree | aa3290c8e453843465711e0f79bd5fd556608a19 | |
parent | 8804b0873136c8934616ac9bbda3a83ff4ff78f9 (diff) | |
download | ATCD-73c00c60fbd26053ecec42943288257f632ad0b1.tar.gz |
ChangeLogTag:Sun Aug 29 07:53:33 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
-rw-r--r-- | ChangeLog-99b | 4 | ||||
-rw-r--r-- | ace/OS.h | 2 | ||||
-rw-r--r-- | ace/OS.i | 7 | ||||
-rw-r--r-- | tests/Signal_Test.cpp | 7 |
4 files changed, 13 insertions, 7 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b index 93625d8b2f4..164bcc52611 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,6 +1,8 @@ Sun Aug 29 07:53:33 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> - * ace/OS: Added a new sigsuspend() wrapper to class ACE_OS. + * ace/OS: Added a new sigsuspend() wrapper to class ACE_OS. This + implementation is "smarter" than the default behavior of + sigsuspend(2) because it'll handle NULL sigset_t *'s gracefully. * ace/config-sunos5.5.h, * ace/config-linux-common.h: Added support for @@ -6005,7 +6005,7 @@ public: int signum); static ACE_SignalHandler signal (int signum, ACE_SignalHandler); - static int sigsuspend (const sigset_t *set = 0); + static int sigsuspend (const sigset_t *set); static int sigprocmask (int how, const sigset_t *nsp, sigset_t *osp); @@ -11677,6 +11677,13 @@ ACE_INLINE int ACE_OS::sigsuspend (const sigset_t *sigset) { #if defined (ACE_HAS_SIGSUSPEND) + sigset_t s; + + if (sigset == 0) + { + sigset = &s; + ACE_OS::sigemptyset (sigset); + } ACE_OSCALL_RETURN (::sigsuspend (sigset), int, -1); #else ACE_UNUSED_ARG (sigset); diff --git a/tests/Signal_Test.cpp b/tests/Signal_Test.cpp index 84bea217a72..b5f192d4237 100644 --- a/tests/Signal_Test.cpp +++ b/tests/Signal_Test.cpp @@ -259,8 +259,7 @@ run_test (ACE_THR_FUNC worker) #endif /* ACE_HAS_THREADS */ } -// This function runs the parent process in a separate worker thread -// for the <ACE_TEST_ONE_CHILDR> test. +// This function runs the parent process in a separate worker thread. static void * worker_parent (void *) @@ -281,12 +280,10 @@ worker_parent (void *) // Perform a <wait> until our child process has exited. - sigset_t s; - ACE_OS::sigemptyset (&s); while (shut_down == 0) { // Wait for a signal to arrive. - if (ACE_OS::sigsuspend (&s) == -1) + if (ACE_OS::sigsuspend (0) == -1) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%P|%t) %p\n"), ASYS_TEXT ("sigsuspend"))); |