#include <Signal.h>
Collaboration diagram for ACE_Sig_Guard:

Public Member Functions | |
| ACE_Sig_Guard (ACE_Sig_Set *mask=0, bool condition=true) | |
| ~ACE_Sig_Guard (void) | |
| Restore blocked signals. | |
| void | dump (void) const |
| Dump the state of an object. | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. | |
Private Attributes | |
| ACE_Sig_Set | omask_ |
| Original signal mask. | |
| bool | condition_ |
| Guard Condition. | |
Definition at line 234 of file Signal.h.
|
||||||||||||
|
This is kind of conditional Guard, needed when guard should be activated only when a spcific condition met. When condition == true (default), Guard is activated Definition at line 225 of file Signal.inl. References SIG_BLOCK, ACE_OS::sigprocmask(), and ACE_OS::thr_sigsetmask().
00227 : omask_ () 00228 , condition_ (condition) 00229 { 00230 //ACE_TRACE ("ACE_Sig_Guard::ACE_Sig_Guard"); 00231 if (!this->condition_) 00232 return; 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 } |
|
|
Restore blocked signals.
Definition at line 40 of file Signal.cpp. References SIG_SETMASK, ACE_OS::sigprocmask(), and ACE_OS::thr_sigsetmask().
00041 {
00042 //ACE_TRACE ("ACE_Sig_Guard::~ACE_Sig_Guard");
00043 if (!this->condition_)
00044 return;
00045
00046 #if !defined (ACE_LACKS_UNIX_SIGNALS)
00047 #if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK)
00048 ACE_OS::sigprocmask (SIG_SETMASK,
00049 (sigset_t *) this->omask_,
00050 0);
00051 #else
00052 ACE_OS::thr_sigsetmask (SIG_SETMASK,
00053 (sigset_t *) this->omask_,
00054 0);
00055 #endif /* ACE_LACKS_PTHREAD_THR_SIGSETMASK */
00056 #endif /* !ACE_LACKS_UNIX_SIGNALS */
00057 }
|
|
|
Dump the state of an object.
Definition at line 70 of file Signal.cpp. References ACE_TRACE.
00071 {
00072 #if defined (ACE_HAS_DUMP)
00073 ACE_TRACE ("ACE_Sig_Guard::dump");
00074 #endif /* ACE_HAS_DUMP */
00075 }
|
|
|
Declare the dynamic allocation hooks.
|
|
|
Guard Condition.
|
|
|
Original signal mask.
|
1.3.6