feat: unify add/remove commands into queue and fix race on channel removal

Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-09 22:03:11 +00:00
parent a8a9c6164b
commit 437ac31913
4 changed files with 68 additions and 50 deletions

View File

@@ -4,10 +4,10 @@
typedef enum {
CMD_CYCLE, // toggle record/stop for a channel
CMD_STOP, // force to idle
// CMD_LOOP_TOGGLE not needed, CYCLE covers it
CMD_BIND_CHANNEL, // bind a channel index (data = channel)
CMD_UNBIND, // reset bind to channel 0
// ADD and REMOVE are still driven via atomics for now
CMD_ADD_CHANNEL, // add a new dynamic channel
CMD_REMOVE_CHANNEL, // remove last dynamic channel
} cmd_type_t;
typedef struct {