1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
// $Id$
#include "ace/Signal.h"
// #include "ace/Log_Category.h"
#if !defined (__ACE_INLINE__)
#include "ace/Signal.inl"
#endif /* __ACE_INLINE__ */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Sig_Action)
void
ACE_Sig_Action::dump (void) const
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_Sig_Action::dump");
#endif /* ACE_HAS_DUMP */
}
ACE_ALLOC_HOOK_DEFINE(ACE_Sig_Set)
ACE_Sig_Set::~ACE_Sig_Set (void)
{
ACE_TRACE ("ACE_Sig_Set::~ACE_Sig_Set");
ACE_OS::sigemptyset (&this->sigset_);
}
ACE_Sig_Action::~ACE_Sig_Action (void)
{
ACE_TRACE ("ACE_Sig_Action::~ACE_Sig_Action");
}
// Restore the signal mask.
ACE_Sig_Guard::~ACE_Sig_Guard (void)
{
//ACE_TRACE ("ACE_Sig_Guard::~ACE_Sig_Guard");
if (!this->condition_)
return;
#if !defined (ACE_LACKS_UNIX_SIGNALS)
#if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK)
ACE_OS::sigprocmask (SIG_SETMASK,
(sigset_t *) this->omask_,
0);
#else
ACE_OS::thr_sigsetmask (SIG_SETMASK,
(sigset_t *) this->omask_,
0);
#endif /* ACE_LACKS_PTHREAD_THR_SIGSETMASK */
#endif /* !ACE_LACKS_UNIX_SIGNALS */
}
void
ACE_Sig_Set::dump (void) const
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_Sig_Set::dump");
#endif /* ACE_HAS_DUMP */
}
ACE_ALLOC_HOOK_DEFINE(ACE_Sig_Guard)
void
ACE_Sig_Guard::dump (void) const
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_Sig_Guard::dump");
#endif /* ACE_HAS_DUMP */
}
ACE_Sig_Action::ACE_Sig_Action (void)
{
// ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
this->sa_.sa_flags = 0;
// Since Service_Config::signal_handler_ is static and has an
// ACE_Sig_Action instance, Win32 will get errno set unless this is
// commented out.
#if !defined (ACE_WIN32)
ACE_OS::sigemptyset (&this->sa_.sa_mask);
#endif /* ACE_WIN32 */
this->sa_.sa_handler = 0;
}
ACE_Sig_Action::ACE_Sig_Action (ACE_SignalHandler sig_handler,
sigset_t *sig_mask,
int sig_flags)
{
// ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
this->sa_.sa_flags = sig_flags;
if (sig_mask == 0)
ACE_OS::sigemptyset (&this->sa_.sa_mask);
else
this->sa_.sa_mask = *sig_mask; // Structure assignment...
#if !defined(ACE_HAS_TANDEM_SIGNALS)
this->sa_.sa_handler = ACE_SignalHandlerV (sig_handler);
#else
this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (sig_handler);
#endif /* !ACE_HAS_TANDEM_SIGNALS */
}
ACE_Sig_Action::ACE_Sig_Action (ACE_SignalHandler sig_handler,
const ACE_Sig_Set &sig_mask,
int sig_flags)
{
// ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
this->sa_.sa_flags = sig_flags;
// Structure assignment...
this->sa_.sa_mask = sig_mask.sigset ();
#if !defined(ACE_HAS_TANDEM_SIGNALS)
this->sa_.sa_handler = ACE_SignalHandlerV (sig_handler);
#else
this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (sig_handler);
#endif /* !ACE_HAS_TANDEM_SIGNALS */
}
ACE_Sig_Action::ACE_Sig_Action (ACE_SignalHandler sig_handler,
int signum,
sigset_t *sig_mask,
int sig_flags)
{
// ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
this->sa_.sa_flags = sig_flags;
if (sig_mask == 0)
ACE_OS::sigemptyset (&this->sa_.sa_mask);
else
this->sa_.sa_mask = *sig_mask; // Structure assignment...
#if !defined(ACE_HAS_TANDEM_SIGNALS)
this->sa_.sa_handler = ACE_SignalHandlerV (sig_handler);
#else
this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (sig_handler);
#endif /* !ACE_HAS_TANDEM_SIGNALS */
ACE_OS::sigaction (signum, &this->sa_, 0);
}
ACE_Sig_Action::ACE_Sig_Action (ACE_SignalHandler sig_handler,
int signum,
const ACE_Sig_Set &sig_mask,
int sig_flags)
{
// ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
this->sa_.sa_flags = sig_flags;
// Structure assignment...
this->sa_.sa_mask = sig_mask.sigset ();
#if !defined(ACE_HAS_TANDEM_SIGNALS)
this->sa_.sa_handler = ACE_SignalHandlerV (sig_handler);
#else
this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (sig_handler);
#endif /* !ACE_HAS_TANDEM_SIGNALS */
ACE_OS::sigaction (signum, &this->sa_, 0);
}
ACE_Sig_Action::ACE_Sig_Action (const ACE_Sig_Set &signals,
ACE_SignalHandler sig_handler,
const ACE_Sig_Set &sig_mask,
int sig_flags)
{
// ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
this->sa_.sa_flags = sig_flags;
// Structure assignment...
this->sa_.sa_mask = sig_mask.sigset ();
#if !defined(ACE_HAS_TANDEM_SIGNALS)
this->sa_.sa_handler = ACE_SignalHandlerV (sig_handler);
#else
this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (sig_handler);
#endif /* !ACE_HAS_TANDEM_SIGNALS */
#if (ACE_NSIG > 0)
for (int s = 1; s < ACE_NSIG; s++)
if ((signals.is_member (s)) == 1)
ACE_OS::sigaction (s, &this->sa_, 0);
#else /* ACE_NSIG <= 0 */
ACE_UNUSED_ARG (signals);
#endif /* ACE_NSIG <= 0 */
}
ACE_Sig_Action::ACE_Sig_Action (const ACE_Sig_Set &signals,
ACE_SignalHandler sig_handler,
sigset_t *sig_mask,
int sig_flags)
{
// ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
this->sa_.sa_flags = sig_flags;
if (sig_mask == 0)
ACE_OS::sigemptyset (&this->sa_.sa_mask);
else
this->sa_.sa_mask = *sig_mask; // Structure assignment...
#if !defined(ACE_HAS_TANDEM_SIGNALS)
this->sa_.sa_handler = ACE_SignalHandlerV (sig_handler);
#else
this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (sig_handler);
#endif /* !ACE_HAS_TANDEM_SIGNALS */
#if (ACE_NSIG > 0)
for (int s = 1; s < ACE_NSIG; s++)
if ((signals.is_member (s)) == 1)
ACE_OS::sigaction (s, &this->sa_, 0);
#else /* ACE_NSIG <= 0 */
ACE_UNUSED_ARG (signals);
#endif /* ACE_NSIG <= 0 */
}
ACE_END_VERSIONED_NAMESPACE_DECL
|