Skip to content

refactor: each context get its own event queue - #1288

Open
mdydek wants to merge 1 commit into
mainfrom
refactor/eventqueue-per-context
Open

mdydek wants to merge 1 commit into
mainfrom
refactor/eventqueue-per-context

Conversation

@mdydek

@mdydek mdydek commented Sep 15, 2026

Copy link
Copy Markdown
Member

Closes #

⚠️ Breaking changes ⚠️

Introduced changes

  • fixes sometimes happening bugs especially in wpt tests, in which there were many context created which used the same queue for the events and it crashed the token invariant introducing multiple producer on single producer channel, now each context gets its own token

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added/Conducted relevant tests
  • Performed self-review of the code
  • Updated Web Audio API coverage
  • Added support for web
  • Updated old arch android spec file

@github-actions

Copy link
Copy Markdown

WPT non-regression comparison

PASS — no regressions · 0 improved section(s) · overall 2717 → 2717 (0)

Unchanged sections (28)
Spec section Base pass Head pass Delta
Processing model 0 0 0
Other 52 52 0
AnalyserNode 138 138 0
AudioBuffer 140 140 0
AudioBufferSourceNode 218 218 0
AudioContext 58 58 0
AudioNode 261 261 0
AudioParam 629 629 0
BiquadFilterNode 275 275 0
ChannelMergerNode 30 30 0
ChannelSplitterNode 7 7 0
ConstantSourceNode 64 64 0
ConvolverNode 203 203 0
DelayNode 104 104 0
DestinationNode 0 0 0
DynamicsCompressorNode 4 4 0
GainNode 15 15 0
IIRFilterNode 87 87 0
MediaElementAudioSourceNode 0 0 0
MediaStreamAudioDestinationNode 1 1 0
MediaStreamAudioSourceNode 0 0 0
OfflineAudioContext 35 35 0
OscillatorNode 104 104 0
PannerNode 75 75 0
PeriodicWave 33 33 0
ScriptProcessorNode 0 0 0
StereoPannerNode 102 102 0
WaveShaperNode 82 82 0

Baseline: d02cb81021cee302f7408c3e801ac59148223636 · Candidate: 23f658b87ca18f731008975c2d1368e4a0a6819a

Workflow run · this comment is updated on every push.

@mdydek mdydek added the refactor Code restructuring without altering external behavior or fixing bugs label Sep 15, 2026

@maciejmakowski2003 maciejmakowski2003 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify comments

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify comments


BoundedPriorityQueue<DeferredEvent, MAX_PENDING_EVENTS, ByDueTime> pending_;
std::shared_ptr<IAudioEventHandlerRegistry> registry_;
std::shared_ptr<AudioEventProducer> audioEventProducer_;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it really has to hold audioEventProducer_?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not, if this queue is designed to always call events from audio thread, why it cannot capture it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without altering external behavior or fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants