Fix error in protected build, user-mode work queue
This commit is contained in:
parent
e702d9396b
commit
740c5c4b7a
@ -154,8 +154,6 @@ void work_process(FAR struct usr_wqueue_s *wqueue)
|
|||||||
work = (FAR struct work_s *)wqueue->q.head;
|
work = (FAR struct work_s *)wqueue->q.head;
|
||||||
while (work)
|
while (work)
|
||||||
{
|
{
|
||||||
DEBUGASSERT(wqueue->wq_sem.count > 0);
|
|
||||||
|
|
||||||
/* Is this work ready? It is ready if there is no delay or if
|
/* 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
|
* 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
|
* 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 */
|
/* Get the delay (in clock ticks) since we started the sampling */
|
||||||
|
|
||||||
elapsed = clock_systimer() - work->qtime;
|
elapsed = clock_systimer() - stick;
|
||||||
if (elapsed <= wqueue->delay)
|
if (elapsed < wqueue->delay && next > 0)
|
||||||
{
|
{
|
||||||
/* How must time would we need to delay to get to the end of the
|
/* 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
|
* 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;
|
remaining = wqueue->delay - elapsed;
|
||||||
next = MIN(next, remaining);
|
next = MIN(next, remaining);
|
||||||
if (next > 0)
|
|
||||||
{
|
|
||||||
/* Wait awhile to check the work list. We will wait here until
|
/* Wait awhile to check the work list. We will wait here until
|
||||||
* either the time elapses or until we are awakened by a signal.
|
* either the time elapses or until we are awakened by a signal.
|
||||||
* Interrupts will be re-enabled while we wait.
|
* 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);
|
usleep(next * USEC_PER_TICK);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
work_unlock();
|
work_unlock();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user