diff options
author | NRK <nrk@disroot.org> | 2023-10-08 02:06:25 +0600 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-10-13 11:36:01 +0200 |
commit | 1abe908e31c40231e52ab2bc9d13ac66558dea73 (patch) | |
tree | 1951396dfc9f7385157140186bd27a8f4ba0a5b9 /osdep/macosx_compat.h | |
parent | e41add29d46bdfc8fdb9933453315e6784717f53 (diff) | |
download | mpv-1abe908e31c40231e52ab2bc9d13ac66558dea73.tar.bz2 mpv-1abe908e31c40231e52ab2bc9d13ac66558dea73.tar.xz |
terminal-unix: avoid data-race on do_deactivate_getch2
do_deactivate_getch2() touches some global variables which *might have*
been fine if the terminal thread was the one that received the signal
but AFAIK which thread will handle the signal is not well defined.
in my case, when quitting mpv with CTRL+C the main thread receives the
signal rather than the terminal thread and touches those globals without
synchronization. caught by ThreadSanitizer.
the solution is to move the do_deactivate_getch2() call outside of the
signal handler.
Diffstat (limited to 'osdep/macosx_compat.h')
0 files changed, 0 insertions, 0 deletions