Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this_cli is a thread-local variable used by functions within SIGWINCH signal handler. This means that it can only be accessed by the main thread (that created it). Previosly however this signal could be handled by any thread of the process, thus occasionally causing SEGFAULTs. In a multithreaded process if a signal is blocked by all threads but one, then the signal will be delivered to the thread expecting it. Using the fact that signal masks are inherited by pthreads this commit blocks SIGWINCH in the beginning of main(before the workers and the screen timer are spawned) and unblocks it just before cli_start(). The unblocking could be moved to scrn_start() function. An alternative to this could be adding a 'handle_winch' atomic to struct cli_scrn. Signed-off-by: Philipp <phila775@gmail.com>
- Loading branch information