Skip to content

Make Windows plugin APIs thread-safe #134346

@stuartmorgan-g

Description

@stuartmorgan-g

Currently many core plugin APIs in Windows are platform-thread only, as on other platforms. However, as discussed in flutter/engine#31134 (review) and #79213 this doesn't work well on Windows, both in terms of OS APIs to facilitate it (there aren't any, unlike other platforms), and convention (Win32 APIs generally don't care what thread you are on). To better match platform conventions, we should make APIs like sending channel messages internally thread safe (by having the embedding internally post them to the platform thread, which we already have a mechanism for).

This may well be straightforward for the C API, but we'll need to make the C++ wrapper that almost all code actually uses that safe as well, which may require some locking.

(We would only do one of #79213 and this.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopa: pluginsSupport for writing, building, and running plugin packagesengineflutter/engine related. See also e: labels.platform-windowsBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform teamtriaged-windowsTriaged by the Windows platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions