mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
clean up signals code in windows
This commit is contained in:
parent
1b1411cae6
commit
a4758c5413
@ -10,11 +10,9 @@ static void* _Atomic signal_nc = ATOMIC_VAR_INIT(NULL);
|
||||
int drop_signals(void* nc){
|
||||
int ret = -1;
|
||||
void* expected = nc;
|
||||
pthread_mutex_lock(&lock);
|
||||
if(atomic_compare_exchange_strong(&signal_nc, &expected, nc)){
|
||||
ret = 0;
|
||||
}
|
||||
pthread_mutex_unlock(&lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -25,6 +23,7 @@ int setup_signals(void* vnc, bool no_quit_sigs, bool no_winch_sigs,
|
||||
int(*handler)(void*)){
|
||||
(void)no_quit_sigs;
|
||||
(void)no_winch_sigs;
|
||||
(void)handler;
|
||||
void* expected = NULL;
|
||||
// don't register ourselves if we don't intend to set up signal handlers
|
||||
// we expect NULL (nothing registered), and want to register nc
|
||||
|
Loading…
Reference in New Issue
Block a user