mirror of
https://github.com/openvswitch/ovs
synced 2025-09-03 15:55:19 +00:00
timeval: Do not block SIGALRM around setting 'deadline' in time_alarm().
There is no need to do so because the signal handler does not read or write 'deadline'. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
@@ -326,17 +326,12 @@ time_alarm(unsigned int secs)
|
|||||||
long long int now;
|
long long int now;
|
||||||
long long int msecs;
|
long long int msecs;
|
||||||
|
|
||||||
sigset_t oldsigs;
|
|
||||||
|
|
||||||
time_init();
|
time_init();
|
||||||
time_refresh();
|
time_refresh();
|
||||||
|
|
||||||
now = time_msec();
|
now = time_msec();
|
||||||
msecs = secs * 1000LL;
|
msecs = secs * 1000LL;
|
||||||
|
|
||||||
block_sigalrm(&oldsigs);
|
|
||||||
deadline = now < LLONG_MAX - msecs ? now + msecs : LLONG_MAX;
|
deadline = now < LLONG_MAX - msecs ? now + msecs : LLONG_MAX;
|
||||||
unblock_sigalrm(&oldsigs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like poll(), except:
|
/* Like poll(), except:
|
||||||
|
Reference in New Issue
Block a user