rtems_task_delete does not remove thread (rtems 4.6.0pre5)

Valery Pykhtin pykhtin at prosoft.ural.ru
Sat Sep 18 09:14:10 UTC 2004


Hi All,

Currently I'm trying to accomplish this test:

rtems_task ThreadFx(rtems_task_argument)
{
      printf("starting\n");  printf("exiting\n");
}

int Cycle()
{
    rtems_status_code rv; rtems_id tr;
    rv =
rtems_task_create(rtems_build_name('t','e','s','t'),120,4096,0,0,&tr);
    if (rv!=RTEMS_SUCCESSFUL) { printf("create failure %d\n",rv);  return
;  }
   rtems_task_start(tr,ThreadFx,0);
   rtems_task_wake_after(2000);
   rv = rtems_task_delete(tr);
   if (rv!=RTEMS_SUCCESSFUL) { printf("delete failure %d\n",rv); }
   return 1;
}
void ThreadTest()
{
    while(Cycle());
}

The problem is that rtems_task_delete does not remove the task reporing
RTEMS_INVALID_ID.
The worst thing in this case is that the space allocated to the task isn't
freed too. After a few Cycles
rtems_task_create reports RTEMS_TOO_MANY.

If I remove rtems_task_wake_after(2000) - all goes well... but this is not
what I want.

Is the idea I should put rtem_task_delete into the ThreadFx() ? I've tried
it and all goes well...

Best regards,
Valery





More information about the users mailing list