Skip to content

Making WinRT Send + Sync #210

@daxpedda

Description

@daxpedda

After doing the research on CoreWindow, I realized we could also make this Send + Sync (like #196), but under different constraints. CoreWindow itself is !Send and there is really nothing we can change here. But WinRT offers a mechanism similar to MacOS's libdispatch, by wrapping the type into a IAgileReference. The wrapper is Send and it can be used to "marshal" function calls to the right thread.

So we have to options:

  • Force WinRtWindowHandle to be a IAgileReference<CoreWindow> instead of CoreWindow and make it Send + Sync.
  • Introduce a new WinRtAgileWindowHandle that is a IAgileReference<CoreWindow>.

Considering there is no overhead for IAgileReference, apart from the cost of creation and resolving, we might want to consider just making it the default WinRtWindowHandle.

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