You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like RawWindowHandle, and the individual platform handles, are marked !Send by default due to the pointers they contain. I couldn't find any documentation one way or another on whether this is explicitly intended to be a part of the safety contract for using a RawWindowHandle or not. I assume that there are some use cases where moving a handle between threads is perfectly safe, and others where it is not. Do existing libraries rely on RawWindowHandle not implementing Send for safety? Or would it be fine for it to impl Send?
The text was updated successfully, but these errors were encountered:
No, for the same reasons raw pointers aren't. Also, not all platforms support doing windowing operations off of the main (ui) thread.
If you need this and are sure it's sound for your use case/target, you should wrap it in a newtype struct and unsafe impl Send for it. I would definitely recommend doing this for a concrete window handle type and not the RawWindowHandle enum, however.
Sounds reasonable to me, and the newtype approach is what I've done in my own code; just wanted to hear some opinions since it isn't mentioned in the docs.
It looks like
RawWindowHandle
, and the individual platform handles, are marked!Send
by default due to the pointers they contain. I couldn't find any documentation one way or another on whether this is explicitly intended to be a part of the safety contract for using aRawWindowHandle
or not. I assume that there are some use cases where moving a handle between threads is perfectly safe, and others where it is not. Do existing libraries rely onRawWindowHandle
not implementingSend
for safety? Or would it be fine for it to implSend
?The text was updated successfully, but these errors were encountered: