Skip to content

Take Glow context using Arc.#248

Merged
asny merged 1 commit intoasny:masterfrom
surban:master
May 19, 2022
Merged

Take Glow context using Arc.#248
asny merged 1 commit intoasny:masterfrom
surban:master

Conversation

@surban
Copy link
Contributor

@surban surban commented May 18, 2022

This allows usage with a Glow context that is passed between threads.

A glow::Context is Send and Sync on native platforms, which is preserved by wrapping it in an Arc<_>. However an Rc<_> takes ownership of the context and binds it to a single thread, since it is !Send and !Sync. This is an unnecessary limitation, since an OpenGL context may be moved between threads, provided that it is only current on one thread at a time.

This allows usage with a Glow context that is passed between threads.
@asny asny merged commit 7ac4f3e into asny:master May 19, 2022
@asny
Copy link
Owner

asny commented May 19, 2022

Makes sense 👍 thanks for the contribution 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants