Skip to content

CoreFoundation thread safety #696

@madsmtm

Description

@madsmtm

Some types like CFRunLoop, CFRunLoopTimer, CFRunLoopSource etc. are thread safe, and should be safe for us to mark Send + Sync as well, except for the fact that any callbacks set via CFRunLoopAddSource/CFRunLoopAddObserver/CFRunLoopAddTimer are not necessarily guaranteed to be thread safe.

Can we assume that that is a guarantee, and then mark the types as Send + Sync?

See also servo/core-foundation-rs#649 and servo/core-foundation-rs#448.

Difficulty: Some objects are toll-free bridged (#693) with the Objective-C variants, and those are usually not thread-safe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frameworkAffects the framework crates and the translator for themenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions