Skip to content

wasapi: Stream no longer Sync #1038

@mnmaita

Description

@mnmaita

I was working on updating rodio and cpal on the bevy crate and I've encountered a couple of build issues for different targets.

I've tested patching cpal by using the following SHA: a8269d3 and the build issues we had went away for MacOS targets. But now, this change seems to have made Stream non-Sync and this breaks a Resource (which need to be both Send and Sync as far as I'm aware) wrapping the audio stream.

The field that seems to be the causing this issue is the event field which has the type struct HANDLE(pub *mut core::ffi::c_void), i.e. Foundation::HANDLE from the windows crate, which doesn't seem to be neither Send nor Sync. I couldn't find how these trait guarantees were upheld before, as a very similar type was being used for this field (https://docs.rs/winapi/latest/winapi/um/winnt/type.HANDLE.html).

I hope this issue has enough detail, and if not please let me know. I might be overlooking something here so any feedback and insights will be welcomed. Thanks a lot for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions