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

Make various types Send and Sync #331

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

qwandor
Copy link
Contributor

@qwandor qwandor commented Nov 21, 2024

FBox should be Send and Sync if its contents is, the same as std::boxed::Box.

Music, Sound, SoundRecorderDriver and SoundBufferRecorder can also be both Send and Sync as far as I can see. They can be Send because nothing about them is tied to a particular thread, and Sync because the underlying C++ implementation uses atomics for shared state they may access.

See #179.

This matches how a std::boxed::Box works.
Music, Sound, SoundRecorderDriver and SoundBufferRecorder should be both
Send and Sync.
@crumblingstatue
Copy link
Collaborator

I'm not an expert on thread safety issues, but on the surface, this looks good to me. Thank you for your contribution!

@crumblingstatue crumblingstatue merged commit 9377b69 into jeremyletang:master Nov 21, 2024
@qwandor qwandor deleted the threadsafety branch November 21, 2024 14:58
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.

2 participants