libvaxis
libvaxis copied to clipboard
fix: avoid deadlock on winsize signal
use an eventfd so than winsize event is sent from input thread
fixes https://github.com/rockorager/libvaxis/issues/218
What is the deadlock you are getting? I don't think this is the correct approach given that it provides a very specific path for Linux only. But I want to understand what the actual problem is better before reviewing much more.
https://github.com/rockorager/libvaxis/issues/218#issuecomment-3275267505
I just got this trace when resizing the window rapidly on macOS 26.0.1 (M1 MacBook Pro):
thread 53557354 panic: Deadlock detected
???:?:?: 0x100f1b49f in _main.panic__struct_2437.panicMaybeToFile (???)
???:?:?: 0x100f22263 in _Thread.Mutex.lock (???)
???:?:?: 0x100ff5e2b in _queue.Queue(vxfw.vxfw.Event,512).push (???)
???:?:?: 0x100fda6af in _Loop.Loop(vxfw.vxfw.Event).postEvent (???)
???:?:?: 0x100fc8917 in _Loop.Loop(vxfw.vxfw.Event).winsizeCallback (???)
???:?:?: 0x100fb0cff in _tty.PosixTty.handleWinch (???)
???:?:?: 0x18e78e743 in ??? (libsystem_platform.dylib)
???:?:?: 0x100fb91d7 in _vxfw.App.run (???)
???:?:?: 0x100fb52a3 in _main.main (???)
???:?:?: 0x100fba983 in _main (???)
???:?:?: 0x18e3c5d53 in ??? (???)
???:?:?: 0x0 in ??? (???)