Example #1
0
void rt_tsk_lock (void) {
  /* Prevent task switching by locking out scheduler */
  if (os_tick_irqn < 0) {
    OS_LOCK();
    os_lock = __TRUE;
    OS_UNPEND(pend_flags);
  } else {
    OS_X_LOCK((U32)os_tick_irqn);
    os_lock = __TRUE;
    OS_X_UNPEND(pend_flags);
  }
}
Example #2
0
void rt_tsk_lock (void) {
  /* Prevent task switching by locking out scheduler */
  if (os_lock == __TRUE) // don't lock again if already locked
    return;

  if (os_tick_irqn < 0) {
    OS_LOCK();
    os_lock = __TRUE;
    OS_UNPEND (&pend_flags);
  } else {
    OS_X_LOCK(os_tick_irqn);
    os_lock = __TRUE;
    OS_X_UNPEND (&pend_flags);
  }
}