Skip to content

Make Window !Send + !Sync #3435

@madsmtm

Description

@madsmtm

Part of #3367, opening to discuss separately.

We've worked hard on trying to make Window safely Send + Sync, but this somewhat obscures what's really happening underneath the hood: Some backends use Mutex, others like macOS/iOS dispatch the events to the main thread (and you may even deadlock if you try to use the window from a thread while the event loop is not running).

So maybe this is actually the wrong solution, and windows should not actually be Send + Sync? Though if we remove it, we'll still have to find some way of allowing users to render on different threads.

Are there other use-cases for Send + Sync windows (other than rendering)?

Related: #3317, #3434.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions