Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MainThreadBound #344

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Add MainThreadBound #344

merged 1 commit into from
Jan 18, 2023

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
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