Skip to content
Commit dc34e7c6 authored by Peter Bigot's avatar Peter Bigot Committed by Anas Nashif
Browse files

kernel: add new work queue implementation



This commit provides a complete reimplementation of the work queue
infrastructure intended to eliminate the race conditions and feature
gaps in the existing implementation.

Both bare and delayable work structures are supported.  Items can be
submitted; delayable items can be scheduled for submission at a future
time.  Items can be delayed, queued, and running all at the same time.
A running item can also be canceling.

The new implementation:
* replaces "pending" with "busy" which identifies the active states;
* supports canceling delayed and submitted items;
* prevents resubmission of a item being canceled until cancellation
  completes;
* supports waiting for cancellation to complete;
* supports flushing a work item (waiting for the last submission to
  complete without preventing resubmission);
* supports waiting for a queue to drain (only allows resubmission from
  the work thread);
* supports stopping a work queue in conjunction with draining it;
* prevents handler-reentrancy during resubmission.

Signed-off-by: default avatarPeter Bigot <peter.bigot@nordicsemi.no>
parent 44539ed6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment