39#ifndef DETERMINISTICESPASYNCWEBSERVER_PREEMPT_QUEUE_H
40#define DETERMINISTICESPASYNCWEBSERVER_PREEMPT_QUEUE_H
44#if DETWS_ENABLE_PREEMPT_QUEUE
54enum class detws_pq_lane : uint8_t
56 DETWS_PQ_LANE_USER = 0,
58 DETWS_PQ_LANE_FORWARD,
68typedef void (*DetwsPqHandler)(
const void *item,
void *ctx);
73 DetwsPqHandler handler;
90bool detws_pq_start_lane(detws_pq_lane lane,
const DetwsPqConfig *cfg);
94bool detws_pq_post_lane(detws_pq_lane lane,
const void *item, uint32_t timeout_ticks);
97bool detws_pq_post_lane_urgent(detws_pq_lane lane,
const void *item, uint32_t timeout_ticks);
100bool detws_pq_post_lane_from_isr(detws_pq_lane lane,
const void *item);
104void detws_pq_drain_lane(detws_pq_lane lane);
107void detws_pq_stop_lane(detws_pq_lane lane);
110bool detws_pq_running_lane(detws_pq_lane lane);
113size_t detws_pq_high_water_lane(detws_pq_lane lane);
117uint8_t detws_pq_lane_priority(detws_pq_lane lane);
122inline bool detws_pq_start(
const DetwsPqConfig *cfg)
124 return detws_pq_start_lane(detws_pq_lane::DETWS_PQ_LANE_USER, cfg);
127inline bool detws_pq_post(
const void *item, uint32_t timeout_ticks)
129 return detws_pq_post_lane(detws_pq_lane::DETWS_PQ_LANE_USER, item, timeout_ticks);
132inline bool detws_pq_post_urgent(
const void *item, uint32_t timeout_ticks)
134 return detws_pq_post_lane_urgent(detws_pq_lane::DETWS_PQ_LANE_USER, item, timeout_ticks);
137inline bool detws_pq_post_from_isr(
const void *item)
139 return detws_pq_post_lane_from_isr(detws_pq_lane::DETWS_PQ_LANE_USER, item);
142inline void detws_pq_drain(
void)
144 detws_pq_drain_lane(detws_pq_lane::DETWS_PQ_LANE_USER);
147inline void detws_pq_stop(
void)
149 detws_pq_stop_lane(detws_pq_lane::DETWS_PQ_LANE_USER);
152inline bool detws_pq_running(
void)
154 return detws_pq_running_lane(detws_pq_lane::DETWS_PQ_LANE_USER);
157inline size_t detws_pq_high_water(
void)
159 return detws_pq_high_water_lane(detws_pq_lane::DETWS_PQ_LANE_USER);
User-facing configuration for DeterministicESPAsyncWebServer.