1
0
forked from aniani/vim

patch 8.2.5141: using "volatile int" in a signal handler might be wrong

Problem:    Using "volatile int" in a signal handler might be wrong.
Solution:   Use "volatile sig_atomic_t".
This commit is contained in:
Bram Moolenaar
2022-06-20 13:38:33 +01:00
parent 73171ba434
commit 155f2d1451
6 changed files with 24 additions and 23 deletions

View File

@@ -8334,9 +8334,9 @@ static int timer_active = FALSE;
* deleted. Ping-ponging between the two flags prevents this causing 'fake'
* timeouts.
*/
static int timeout_flags[2];
static int timeout_flag_idx = 0;
static int *timeout_flag = &timeout_flags[0];
static sig_atomic_t timeout_flags[2];
static int timeout_flag_idx = 0;
static sig_atomic_t *timeout_flag = &timeout_flags[0];
static void CALLBACK
@@ -8378,7 +8378,7 @@ stop_timeout(void)
* This function is not expected to fail, but if it does it still returns a
* valid flag pointer; the flag will remain stuck at zero.
*/
volatile int *
volatile sig_atomic_t *
start_timeout(long msec)
{
BOOL ret;