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

Running EventLoop::run_return in a separate thread does not work #26

Open
KyGost opened this issue Dec 10, 2021 · 2 comments
Open

Running EventLoop::run_return in a separate thread does not work #26

KyGost opened this issue Dec 10, 2021 · 2 comments

Comments

@KyGost
Copy link

KyGost commented Dec 10, 2021

Creating an event loop, giving it to a context and then running it via run_return in a new thread seems to give peculiar behaviour and does not error.

@lcnr
Copy link
Owner

lcnr commented Dec 10, 2021

hmm, this looks like contexts simply shouldn't be Send/Sync or something like that 🤔 so I believe that instead of supporting this, it's probably far easier to error.

Do you have an MVCE for this? Should probably be enough to post the code for which you got this behavior

@KyGost
Copy link
Author

KyGost commented Dec 11, 2021

Just something along the lines of:

let event_loop = EventLoop::new();
let mut context = Context::new(WindowBuilder::new(), &event_loop);
event_loop.run_return(...); // Works
thread::spawn(||{
  event_loop.run_return(...); // Doesn't work, weird graphical artifacting and whatnot
});

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

No branches or pull requests

2 participants