Skip to content

Conversation

@madsmtm
Copy link
Owner

@madsmtm madsmtm commented Jan 15, 2023

For wrapping types like Id<NSWindow, Shared> which is only safe to access from the main thread.

Should help pushing rust-windowing/winit#2464 forwards.

Previous main thread work: #27

TODO:

  • Proper safety comments
  • The actual implementation for when the thread is not the main thread (basically just dispatch::Queue::main()::exec(|| ...)
  • Figure out relation to Swift's @MainActor

@madsmtm madsmtm added enhancement New feature or request A-framework Affects the framework crates and the translator for them labels Jan 15, 2023
@madsmtm madsmtm marked this pull request as ready for review January 15, 2023 21:40
@madsmtm madsmtm force-pushed the main-thread-bound branch 6 times, most recently from 1fad259 to f78a13a Compare January 15, 2023 22:43
@madsmtm madsmtm merged commit c2fa0ab into master Jan 18, 2023
@madsmtm madsmtm deleted the main-thread-bound branch January 18, 2023 22:33
@madsmtm madsmtm added this to the icrate v0.1.0 milestone Jan 27, 2023
madsmtm pushed a commit that referenced this pull request Jan 12, 2026
…st()` (#351)

Noticed that one more pointer was being transmuted to another type
rather than using a trivial cast, before `unsafe`ly dereferencing it.

This also removes the `ptr::read()` syntax introduced in #344 again,
in favour of using a simple and more standard `*` deref.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-framework Affects the framework crates and the translator for them enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant