Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUDIO_WORKLET] Fix spinlocks for audio worklets (and add tests) #23393

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cwoffenden
Copy link
Contributor

@cwoffenden cwoffenden commented Jan 14, 2025

Fix for #22962. In brief:

  • spinlocks fixed so they work in audio worklets
  • adds tests for various spinlock cases
  • test renamed to match its new use
  • test converted to C-only (like the other tests, plus it wasn't using C++ features)

This is an update to #22995 which had become hard to track. The spinlocks are moved to using emscripten_get_now() so they can be used in Audio Worklets, and a set of interactive tests added for the spinlock use cases.

The test can be run with:

test/runner interactive.test_audio_worklet_emscripten_locks

Or standalone with:

emcc -sAUDIO_WORKLET -sWASM_WORKERS -pthread audioworklet_emscripten_locks.c

I can change the other emscripten_performance_now() calls to emscripten_get_now() (as suggested in #22995) in a separate PR.

@cwoffenden cwoffenden marked this pull request as ready for review January 14, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant