File syn_workqueue.c¶
FileList > sched > syn_workqueue.c
Go to the source code of this file
Deferred work queue implementation.
#include "../util/syn_assert.h"#include "syn_workqueue.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| void | syn_workqueue_init (SYN_WorkQueue * wq, SYN_WorkItem * buf, size_t capacity) Initialize the work queue. |
| bool | syn_workqueue_post (SYN_WorkQueue * wq, SYN_WorkFunc func, void * ctx) Post a work item. ISR-safe (single producer). |
| size_t | syn_workqueue_process (SYN_WorkQueue * wq) Process all pending work items. |
Public Functions Documentation¶
function syn_workqueue_init¶
Initialize the work queue.
Parameters:
wqPointer to work queue context to initialize.bufBacking storage array for work items.capacityNumber of elements in the buffer.
function syn_workqueue_post¶
Post a work item. ISR-safe (single producer).
Parameters:
wqPointer to work queue context.funcCallback function to defer.ctxUser data passed to the callback.
Returns:
true if posted, false if queue is full.
function syn_workqueue_process¶
Process all pending work items.
Call from main loop. Executes each queued function in FIFO order.
Parameters:
wqPointer to work queue context.
Returns:
Number of items processed.
The documentation for this class was generated from the following file src/syntropic/sched/syn_workqueue.c