rtems_task_wake_after(0)

Eric Norum wenorum at lbl.gov
Tue Jan 29 19:34:38 UTC 2013


Here's the code:

rtems_status_code rtems_task_wake_after(
  rtems_interval ticks
)
{
  _Thread_Disable_dispatch();
    if ( ticks == 0 ) {
      _Thread_Yield_processor();
    } else {
      _Thread_Set_state( _Thread_Executing, STATES_DELAYING );
      _Watchdog_Initialize(
        &_Thread_Executing->Timer,
        _Thread_Delay_ended,
        _Thread_Executing->Object.id,
        NULL
      );
      _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks );
    }
  _Thread_Enable_dispatch();
  return RTEMS_SUCCESSFUL;
}



As you can see, calling with a value of 0 really is completely safe.

On Jan 29, 2013, at 11:28 AM, Andrei Chichak <groups at chichak.ca> wrote:

> 
> On 2013-January-29, at 12:02 PM, Eric Norum wrote:
> 
>> rtems_task_wake_after(0) is essentially a yield() operation -- other tasks  at the same priority level are given a chance to run.
>> There are the required checks, locks and code to ensure that rtems_task_wake_after(0) can't turn into rtems_task_wake_after(A_REALLY_LONG_TIME).  Or at least there are on a properly written CPU support module….
> 
> Oh, goodie, then I'm golden since this is running on a Coldfire 5282 and, I believe, that's your code. Just kidding, I think I'll avoid the problem and add a handful of ticks.
> 
> Andrei
> (Figley says hello and wants to tell you that Rachael is in first year Engineering)
> 
> ---------------------
> Andrei Chichak
> 
> Systems Developer
> CBF Systems Inc.
> 4-038 NINT INNOVATION CENTRE
> 11421 SASKATCHEWAN DRIVE
> EDMONTON, ALBERTA
> T6G 2M9
> CANADA
> 
> Phone: 780-628-2072
> Skype: andrei.chichak
> 
> 
> 
> 
> 
> 
> 
> 

-- 
Eric Norum
wenorum at lbl.gov





More information about the users mailing list