summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/nanosleep.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-02-18 08:36:26 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-04 13:36:10 +0100
commit03b900d3ed120ea919ea3eded7edbece3488cff3 (patch)
tree182781fc14fe15fd67caeb80e46f1c58495839c2 /cpukit/posix/src/nanosleep.c
parentscore: Distribute clock tick to all online CPUs (diff)
downloadrtems-03b900d3ed120ea919ea3eded7edbece3488cff3.tar.bz2
score: Replace watchdog handler implementation
Use a red-black tree instead of delta chains. Close #2344. Update #2554. Update #2555. Close #2606.
Diffstat (limited to 'cpukit/posix/src/nanosleep.c')
-rw-r--r--cpukit/posix/src/nanosleep.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/posix/src/nanosleep.c b/cpukit/posix/src/nanosleep.c
index 46697ae8fc..21bdb986b6 100644
--- a/cpukit/posix/src/nanosleep.c
+++ b/cpukit/posix/src/nanosleep.c
@@ -46,6 +46,7 @@ int nanosleep(
Per_CPU_Control *cpu_self;
Watchdog_Interval ticks;
+ Watchdog_Interval start;
Watchdog_Interval elapsed;
@@ -81,6 +82,8 @@ int nanosleep(
return 0;
}
+ start = _Watchdog_Ticks_since_boot;
+
/*
* Block for the desired amount of time
*/
@@ -96,7 +99,7 @@ int nanosleep(
* Calculate the time that passed while we were sleeping and how
* much remains from what we requested.
*/
- elapsed = executing->Timer.stop_time - executing->Timer.start_time;
+ elapsed = _Watchdog_Ticks_since_boot - start;
if ( elapsed >= ticks )
ticks = 0;
else