lcnr/crow

Running `EventLoop::run_return` in a separate thread does not work

Opened this issue · 2 comments

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 commented

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

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
});