Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sdptr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
sdptr
Commits
8d49f8dc
Commit
8d49f8dc
authored
3 years ago
by
Pieter Donker
Browse files
Options
Downloads
Patches
Plain Diff
L2SDP-499
, changes to prevent 100% load after returning from sleep/hibernate.
parent
affaa157
No related branches found
No related tags found
1 merge request
!28
Resolve L2SDP-489
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sdptr.cpp
+16
-4
16 additions, 4 deletions
src/sdptr.cpp
with
16 additions
and
4 deletions
src/sdptr.cpp
+
16
−
4
View file @
8d49f8dc
...
@@ -76,7 +76,19 @@ void monitor()
...
@@ -76,7 +76,19 @@ void monitor()
while
(
ServerRunning
)
{
while
(
ServerRunning
)
{
struct
timespec
current_time_timespec
;
clock_gettime
(
CLOCK_REALTIME
,
(
struct
timespec
*
)
&
current_time_timespec
);
SD
.
t0
.
tv_sec
=
SD
.
t0
.
tv_sec
+
SD
.
timetick
;
// specify next position in time
SD
.
t0
.
tv_sec
=
SD
.
t0
.
tv_sec
+
SD
.
timetick
;
// specify next position in time
if
(
SD
.
t0
.
tv_sec
<
current_time_timespec
.
tv_sec
)
{
// skip ahead if we already are beyond the next tick.
// this prevents us from trying to catch up if the host system
// was in hibernation or this process was otherwise suspended.
// this means that SD.uptime will reflect the number of seconds
// this process was actually running, and now - SD.start_time
// reflects the wall-clock time that passed since start.
SD
.
t0
.
tv_sec
=
current_time_timespec
.
tv_sec
+
SD
.
timetick
;
}
SD
.
t0
.
tv_nsec
=
10000000L
;
// 0..999999999 // offset 10ms in a new second
SD
.
t0
.
tv_nsec
=
10000000L
;
// 0..999999999 // offset 10ms in a new second
pthread_mutex_lock
(
&
SD
.
newpoint_lock
);
pthread_mutex_lock
(
&
SD
.
newpoint_lock
);
pthread_cond_timedwait
(
&
SD
.
newpoint_cond
,
&
SD
.
newpoint_lock
,
(
const
struct
timespec
*
)
&
SD
.
t0
);
pthread_cond_timedwait
(
&
SD
.
newpoint_cond
,
&
SD
.
newpoint_lock
,
(
const
struct
timespec
*
)
&
SD
.
t0
);
...
...
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