Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Sig_Guard Class Reference

Hold signals in MASK for duration of a C++ statement block. Note that a "0" for mask causes all signals to be held. More...

#include <Signal.h>

Collaboration diagram for ACE_Sig_Guard:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Sig_Guard (ACE_Sig_Set *mask=0)
 Block out signals in <mask>. Default is to block all signals! More...

 ~ACE_Sig_Guard (void)
 Restore blocked signals. More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Private Attributes

ACE_Sig_Set omask_
 Original signal mask. More...


Detailed Description

Hold signals in MASK for duration of a C++ statement block. Note that a "0" for mask causes all signals to be held.

Definition at line 230 of file Signal.h.


Constructor & Destructor Documentation

ACE_INLINE ACE_Sig_Guard::ACE_Sig_Guard ACE_Sig_Set   mask = 0
 

Block out signals in <mask>. Default is to block all signals!

Definition at line 229 of file Signal.i.

References ACE_OS_Object_Manager::default_mask, SIG_BLOCK, ACE_OS::sigprocmask, and ACE_OS::thr_sigsetmask.

00230   : omask_ ()
00231 {
00232   //ACE_TRACE ("ACE_Sig_Guard::ACE_Sig_Guard");
00233 
00234 #if defined (ACE_LACKS_UNIX_SIGNALS)
00235   ACE_UNUSED_ARG (mask);
00236 #else
00237   // If MASK is 0 then block all signals!
00238   if (mask == 0)
00239     {
00240 #  if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK)
00241       ACE_OS::sigprocmask (SIG_BLOCK,
00242                            ACE_OS_Object_Manager::default_mask (),
00243                            (sigset_t *) this->omask_);
00244 #  else
00245       ACE_OS::thr_sigsetmask (SIG_BLOCK,
00246                               ACE_OS_Object_Manager::default_mask (),
00247                               (sigset_t *) this->omask_);
00248 #  endif /* ACE_LACKS_PTHREAD_THR_SIGSETMASK */
00249     }
00250   else
00251 #  if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK)
00252     ACE_OS::sigprocmask (SIG_BLOCK,
00253                          (sigset_t *) *mask,
00254                          (sigset_t *)
00255                          this->omask_);
00256 #  else
00257     ACE_OS::thr_sigsetmask (SIG_BLOCK,
00258                             (sigset_t *) *mask,
00259                             (sigset_t *)
00260                             this->omask_);
00261 #  endif /* ACE_LACKS_PTHREAD_THR_SIGSETMASK */
00262 #endif /* ACE_LACKS_UNIX_SIGNALS */
00263 }

ACE_INLINE ACE_Sig_Guard::~ACE_Sig_Guard void   
 

Restore blocked signals.

Definition at line 268 of file Signal.i.

References SIG_SETMASK, ACE_OS::sigprocmask, and ACE_OS::thr_sigsetmask.

00269 {
00270   //ACE_TRACE ("ACE_Sig_Guard::~ACE_Sig_Guard");
00271 #if !defined (ACE_LACKS_UNIX_SIGNALS)
00272 #if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK)
00273   ACE_OS::sigprocmask (SIG_SETMASK,
00274                        (sigset_t *) this->omask_,
00275                        0);
00276 #else
00277   ACE_OS::thr_sigsetmask (SIG_SETMASK,
00278                           (sigset_t *) this->omask_,
00279                           0);
00280 #endif /* ACE_LACKS_PTHREAD_THR_SIGSETMASK */
00281 #endif /* !ACE_LACKS_UNIX_SIGNALS */
00282 }


Member Function Documentation

void ACE_Sig_Guard::dump void    const
 

Dump the state of an object.

Definition at line 73 of file Signal.cpp.

References ACE_TRACE.

00074 {
00075   ACE_TRACE ("ACE_Sig_Guard::dump");
00076 }


Member Data Documentation

ACE_Sig_Guard::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 244 of file Signal.h.

ACE_Sig_Set ACE_Sig_Guard::omask_ [private]
 

Original signal mask.

Definition at line 248 of file Signal.h.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:56:08 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002