[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rt_task_suspend and pthread_suspend_np



Hello,
 
there seems to be a difference between
rt_task_suspend and pthread_suspend_np
 
My task is not working any more with Version V2.0 for Linux 2.2.13.
I have a programm for AD conversion for RTLinux.
One periodic task (every 30 s) triggers the conversion task (250µs) running 15 times and then suspends itself for the next trigger.
Version V1.3 for Linux 2.0.37 worked very well but Version V2.0 for Linux 2.2.13 doesn' t stop.
 
Where is my mistake ? How to solve the problem?
 
Thanks for your help!
 
Here the abstract example Version V1.3 for Linux 2.0.37
void SystemTask (int FIFO) {
  while (1) {
  .......
  }
  rt_task_make_periodic(&tasks[0], rt_get_time(),250*microsec);
  rt_task_wait();
 }
}
 
void AD_Convert (int FIFO) {
while (1) {
  switch (++CntConversion) {
    case 1: /* Register löschen */
    ........
    case 15:
      CntConversion = 0;
      break;
    default:
  CntConversion = 0;
  }
  if (CntConversion == 0) {
    rt_task_suspend(&tasks[0]);
  } else {
   rt_task_wait();
  }
 }
}
 
Programmed for Version V2.0 for Linux 2.2.13
 
void *SystemTask (void *VFIFO) {
  int FIFO = (int) VFIFO;
  while (1) {
  ....
  }
  pthread_make_periodic_np (tasks[0], gethrtime(),250*microsec);
  pthread_wait_np();
  }
}
 
void *AD_Convert (void *VFIFO) {
  while (1) {
  switch (++CntConversion) {
    case 1: /* Register löschen */
    case 15:
      CntConversion = 0; 
      break;
    default:
      CntConversion = 0;
    }
    if (CntConversion == 0) {
      pthread_suspend_np(tasks[0]);
    } else {
      pthread_wait_np();
    }
   }
 }
 
kind regards
Thomas Held
t_held@hotmail.com