Thanks Philippe,
The fix is correct.

Michael.

Philippe Gerum ([EMAIL PROTECTED]) wrote:
> 
> Hi all,
> 
> I'm using Jerry Epplin's RT-IPC package from a stock rtlinux-2.3pre3
> distro on an Intel box, and I have a strange behavior with timed
> services, like rt_mq_receive() and rt_sem_wait(). In fact, these
> services do not wait for the amount of time expected but immediately
> return instead with a -ETIME status.
> The code shows that rt_task_delay() is called internally by the timed
> services to provide the needed wait. Cross-checking rt_task_delay()
> with RTL's native usleep() routine, I found that the current thread is
> not marked for suspension in the former. Applying the following change
> (at least) seems to fix the problem:
> 
> int rt_task_delay(RTIME duration)
> {
>    int ret = 0;
>    int flags;
>    rtl_critical(flags);
>    /* mark the task as delayed */
>    pthread_self()->resume_time = HRT_FROM_8254(duration);
>    pthread_self()->period = 0;
> ++ RTL_MARK_SUSPENDED(pthread_self());
>    set_bit (RTL_THREAD_TIMERARMED, &pthread_self() -> threadflags);
>    /* set the time at which execution may resume */
>    rtl_schedule();
>    rtl_end_critical(flags);
>    return ret;
> }
> 
> Can somebody tell me if I'm right or wrong please, so I can stop
> banging my head against my office's walls ? 8o) Sorry if this is a
> beaten issue, but I found no reference in the mail archives.
> 
> PS: The IPC package from a stock rtlinux-3.0pre6e is also concerned.
> 
> Cheers,
> Philippe.
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to