-
Notifications
You must be signed in to change notification settings - Fork 950
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
MacOS backend can trigger UB if a Window
is transferred between threads then had functions on NSView
called.
#873
Comments
NSView
called. (Where the latter might not necessarily be happening, although I would not be suprized if it is)
NSView
called. (Where the latter might not necessarily be happening, although I would not be suprized if it is)Window
is made from non-main thread, or transfered between threads then had functions on NSView
called.
Window
is made from non-main thread, or transfered between threads then had functions on NSView
called.Window
is made from a non-main thread, or transfered between threads then had functions on NSView
called.
Window
is made from a non-main thread, or transfered between threads then had functions on NSView
called.Window
is made from a non-main thread, or transferred between threads then had functions on NSView
called.
Might not necessarily be the case, as pointed out by @mtak-. #871 (comment) |
As of |
@aleksijuvani That's a good point. Also, since |
Window
is made from a non-main thread, or transferred between threads then had functions on NSView
called.Window
is transferred between threads then had functions on NSView
called.
Closing this, since all the magic I did with GCD (which has since been improved by others!) made this a non-issue as of EL2's release. |
As stated in the lengthy title, the MacOS backend can trigger UB if a
Window
is made from a non-main thread, or transferred between threads then had functions onNSView
called. (Where the latter might not necessarily be happening, although I would not be suprized if it is, as I haven't looked too hard at the code.)According to the cocoa docs:
Yet for some reason, not only does winit create
NSView
s on non-main threads when creating a window, but somehow we for some reason implementSend + Sync
onWindow
!I could swear that the glutin docs mentioned at least in one place that the window isn't always
Send
orSync
, but after grepping the whole source I can't figure out where. Nevertheless, this discrepancy between what should be and what is has lead to numerous people asking about it - or maybe I just bug too many people about it.The text was updated successfully, but these errors were encountered: