Relax constraints on callbacks by dropping Sync requirement#69
Relax constraints on callbacks by dropping Sync requirement#69kinetiknz wants to merge 2 commits intomozilla:masterfrom
Conversation
…ent. A cubeb backend may run user callbacks on any thread it chooses to, but must never run the same user callback on multiple threads concurrently. If I understand correctly, the `Send` constraint is sufficient to represent the appropriate constraint for this, making `Sync` unnecessary. Fixes mozilla#68
|
I noticed that the state changed callback and device changed callback can be called from threads other than the audio I/O thread. E.g. with the macOS CoreAudio backend:
This makes me think that maybe the other callbacks need to be kept as |
This seems true for data callback, but I guess cubeb can fire two different state callbacks at a time on the Mac platform. Suppose we unplug the device after the stream start in the following procedure:
We should probably fix this on the cubeb-coreaudio and check it we have similar problems on other backends. We could remove |
A cubeb backend may run user callbacks on any thread it chooses to, but must never run the same user callback on multiple threads concurrently. If I understand correctly, the
Sendconstraint is sufficient to represent the appropriate constraint for this, makingSyncunnecessary.Fixes #68