Fix error in protected build, user-mode work queue

This commit is contained in:
Gregory Nutt 2014-10-12 09:40:26 -06:00
parent e702d9396b
commit 740c5c4b7a

View File

@ -154,8 +154,6 @@ void work_process(FAR struct usr_wqueue_s *wqueue)
work = (FAR struct work_s *)wqueue->q.head;
while (work)
{
DEBUGASSERT(wqueue->wq_sem.count > 0);
/* Is this work ready? It is ready if there is no delay or if
* the delay has elapsed. qtime is the time that the work was added
* to the work queue. It will always be greater than or equal to
@ -248,8 +246,8 @@ void work_process(FAR struct usr_wqueue_s *wqueue)
/* Get the delay (in clock ticks) since we started the sampling */
elapsed = clock_systimer() - work->qtime;
if (elapsed <= wqueue->delay)
elapsed = clock_systimer() - stick;
if (elapsed < wqueue->delay && next > 0)
{
/* How must time would we need to delay to get to the end of the
* sampling period? The amount of time we delay should be the smaller
@ -259,8 +257,7 @@ void work_process(FAR struct usr_wqueue_s *wqueue)
remaining = wqueue->delay - elapsed;
next = MIN(next, remaining);
if (next > 0)
{
/* Wait awhile to check the work list. We will wait here until
* either the time elapses or until we are awakened by a signal.
* Interrupts will be re-enabled while we wait.
@ -268,7 +265,6 @@ void work_process(FAR struct usr_wqueue_s *wqueue)
usleep(next * USEC_PER_TICK);
}
}
work_unlock();
}