Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
b67adedc
Commit
b67adedc
authored
May 11, 2019
by
Micha Mueller
Browse files
Fix dcdbpusher not terminating if no thraeds executing sensor groups are available
parent
2436f553
Changes
1
Hide whitespace changes
Inline
Side-by-side
dcdbpusher/includes/SensorGroupInterface.h
View file @
b67adedc
...
...
@@ -68,11 +68,22 @@ public:
/**
* Does a busy wait until all dispatched handlers are finished (_pendingTasks == 0)
* If the wait takes longer than a reasonable amount of time we return anyway,
* to not block termination of dcdbpusher.
*/
void
wait
()
{
while
(
_pendingTasks
)
{
sleep
(
1
);
}
unsigned
short
retries
=
3
;
for
(
unsigned
short
i
=
1
;
i
<=
retries
;
i
++
)
{
if
(
_pendingTasks
)
{
LOG
(
info
)
<<
"Group "
<<
_groupName
<<
" not yet finished. Waiting... ("
<<
i
<<
"/"
<<
retries
<<
")"
;
sleep
((
_interval
/
1000
)
+
1
);
}
else
{
return
;
}
}
LOG
(
warning
)
<<
"Group "
<<
_groupName
<<
" will not finish! Skipping it"
;
}
//can be overwritten
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment