Opened on 08/08/08 at 11:23:04
Closed on 08/20/08 at 12:29:59
#1296 closed defect (fixed)
POSIX timers use incorrect repeat interval.
Reported by: | Tim FitzGeorge | Owned by: | Joel Sherrill |
---|---|---|---|
Priority: | normal | Milestone: | 4.9 |
Component: | score | Version: | 4.9 |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: |
Description
The POSIX specification for timer_settime() states that a timer uses value.it_value for the initial timeout period and value.it_interval for the repeat period. The code in timersettime.c (4.9) and ptimer1.c (4.8) uses value.it_value for both.
The code checks value.it_interval , and if it is non-zero sets the timer as a repeating timer, but uses timer.it_value for the period.
The current code (from timersettime.c)
ptimer->ticks = _Timespec_To_ticks( &normalize.it_value );
activated = _POSIX_Timer_Insert_helper(
&ptimer->Timer,
ptimer->ticks,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
should be something like:
ticks = _Timespec_To_ticks( &normalize.it_value );
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
activated = _POSIX_Timer_Insert_helper(
&ptimer->Timer,
ticks,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
The code for 4.8 needs a similar change for both absolute and relative timers.
In addition a test case needs to be created. A possibility would be modifying psxtimer.c to use double the repeat period for the initial delay.
Attachments (3)
Change History (4)
Changed on 08/18/08 at 18:34:41 by Tim FitzGeorge
Attachment: | psxtimer.c added |
---|
Changed on 08/18/08 at 19:54:43 by Tim FitzGeorge
Attachment: | patch-rtems_head-timer_settime.txt added |
---|
Patch for HEAD
Changed on 08/19/08 at 20:48:13 by Tim FitzGeorge
Attachment: | patch-rtems_4_8_branch-timer_settime.txt added |
---|
Patch for rtems-4-8-branch
comment:1 Changed on 08/20/08 at 12:29:59 by Joel Sherrill
Resolution: | → fixed |
---|---|
Status: | new → closed |
See PR1298 to track the issue for timers in the past
Test case for bug.