Remove unsound SendSyncWrapper#3303
Conversation
e79d4ce to
014f5d9
Compare
reading pointer value is not unsound by any means, if you deref raw pointers during
you can't do anything with it outside the main thread, and if you can do then builder has nothing to do with it, we have the same API throughout the code base on a Send + Sync types with the exact same values. |
I think you are talking about
I think there is a misunderstanding here. If this isn't an issue, then |
Window is |
This isn't the same thing, I hope the problem is apparent now, |
madsmtm
left a comment
There was a problem hiding this comment.
Flyby review, unsure what's the correct approach here.
| /// which is `unsafe`. | ||
| #[derive(Debug, Clone)] | ||
| #[cfg(feature = "rwh_06")] | ||
| pub(crate) struct SendSyncRawWindowHandle(pub(crate) rwh_06::RawWindowHandle); |
014f5d9 to
55ec80e
Compare
55ec80e to
1b9fb93
Compare
1b9fb93 to
5c1e056
Compare
|
I split out the Web part into #3320. |
5c1e056 to
54ba38f
Compare
I noticed that
SendSyncWrappercaused some real issues here and there. First #3270 and #3288, then #3297.Also noticed that we simply used
SendSyncWrapperonFullscreeninsideWindowBuilder, but there is a getter that exposes this information to the user, bypassing the!SynconFullscreenon MacOS, depending if this!Syncwas correct or not, that may have been unsound.Additionally on Web there was an issue where dropping
WindowBuilderoutside the main thread could cause it to try and dropHtmlCanvasElement, which is unsound as well (not entirely sure if that is correct, but it's at least semantically correct).Additionally implementing
DebugonSendSyncWrapperwas unsound as well, becauseDebugcould access the inner value off the only thread it was intended to be accessed on. Which was the case forWindowBuilderon Web withHtmlCanvasElementand the custom wrapper I used forCustomCursor.All in all I would say
SendSyncWrapperis a footgun and apart from theRawWindowHandlev0.4 and v0.5 we didn't even really need it.