Closed mr-mocap closed 1 year ago
Thanks for reporting this! Yes, this sounds like a valid problem.
Happy to wait for your fix if you have one ;-)
you may replace signal
with signalfd
I thought about that. I wanted something closer to what already exists. We can always improve!
I can look into it tonight.
This has been fixed.
Summary: Start up an FTXUI app and then begin resizing. You will quickly see that the terminal stops updating. In fact, the entire UI is now non-responsive.
One Possible Reason: First of all, only have a single thread in your program. Second, it looks like a SIGWINCH can occur while the Receiver class is holding a lock on the mutex. If this happens, the OnResize() code tries to then Send() an Event, which ends up trying to acquire a lock on the same mutex (The original lock is still held during the signal). The process can then end up in the condition_variable's wait()... waiting on the same thread to unlock that other mutex (which, of course, it cannot).
I've already found and implemented a solution for this, which is a rather small change.