Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ipc
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Scott Snyder
ipc
Commits
5ce456e4
Commit
5ce456e4
authored
3 years ago
by
Serguei Kolos
Browse files
Options
Downloads
Patches
Plain Diff
Rename 'signals' parameter to avoid clash with Qt #define
parent
1e4592f7
No related branches found
Branches containing commit
Tags
ipc-05-14-08
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ipc/signal.h
+3
-4
3 additions, 4 deletions
ipc/signal.h
src/signal.cc
+4
-4
4 additions, 4 deletions
src/signal.cc
with
7 additions
and
8 deletions
ipc/signal.h
+
3
−
4
View file @
5ce456e4
...
...
@@ -17,18 +17,17 @@ namespace daq
namespace
ipc
{
/*! \brief This class can be used for blocking a thread until a signal is received.
* *
* \ingroup public
*/
class
signal
{
public:
static
int
wait_for
(
std
::
vector
<
int
>
const
&
sign
al
s
=
{
SIGINT
,
SIGTERM
},
std
::
vector
<
int
>
const
&
sign
um
s
=
{
SIGINT
,
SIGTERM
},
uint32_t
precision_ms
=
1000
)
noexcept
;
static
int
raise
(
int
sig
=
SIGTERM
)
{
return
::
raise
(
sig
);
static
int
raise
(
int
sig
num
=
SIGTERM
)
{
return
::
raise
(
sig
num
);
}
private
:
...
...
This diff is collapsed.
Click to expand it.
src/signal.cc
+
4
−
4
View file @
5ce456e4
...
...
@@ -17,11 +17,11 @@ typedef void (*SignalHandler)(int);
volatile
std
::
sig_atomic_t
signal
::
m_signal
;
int
signal
::
wait_for
(
std
::
vector
<
int
>
const
&
sign
al
s
,
int
signal
::
wait_for
(
std
::
vector
<
int
>
const
&
sign
um
s
,
uint32_t
precision_ms
)
noexcept
{
std
::
map
<
int
,
SignalHandler
>
old_handlers
;
for
(
auto
it
=
sign
al
s
.
begin
();
it
!=
sign
al
s
.
end
();
++
it
)
{
for
(
auto
it
=
sign
um
s
.
begin
();
it
!=
sign
um
s
.
end
();
++
it
)
{
SignalHandler
sh
=
std
::
signal
(
*
it
,
signalHandler
);
if
(
sh
!=
SIG_ERR
)
{
old_handlers
[
*
it
]
=
sh
;
...
...
@@ -41,7 +41,7 @@ int signal::wait_for(std::vector<int> const& signals,
return
m_signal
;
}
void
signal
::
signalHandler
(
int
sig
)
void
signal
::
signalHandler
(
int
sig
num
)
{
m_signal
=
sig
;
m_signal
=
sig
num
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment