diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-03-29 00:30:53 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-03-29 00:30:53 +0200 |
commit | 0c1110ace2f247d2605599bb02f2866aee2ab1c6 (patch) | |
tree | 9b70a5d254b5289532e9017a9a00180eaea413d1 /sys/src/9/port/portdat.h | |
parent | bfae9e08be692b944ab3018d98693a15ca38a64c (diff) |
kernel: fix twakeup()/timerdel() race condition
timerdel() did not make sure that the timer function
is not active (on another cpu). just acquiering the
Timer lock in the timer function only blocks the caller
of timerdel()/timeradd() but not the other way arround
(on a multiprocessor).
this changes the timer code to track activity of
the timer function, having timerdel() wait until
the timer has finished executing.
Diffstat (limited to 'sys/src/9/port/portdat.h')
-rw-r--r-- | sys/src/9/port/portdat.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/src/9/port/portdat.h b/sys/src/9/port/portdat.h index 00519897e..c91e7a29c 100644 --- a/sys/src/9/port/portdat.h +++ b/sys/src/9/port/portdat.h @@ -556,6 +556,7 @@ struct Timer void *ta; /* Internal */ Lock; + Mach *tactive; /* The cpu that tf is active on */ Timers *tt; /* Timers queue this timer runs on */ Tval tticks; /* tns converted to ticks */ Tval twhen; /* ns represented in fastticks */ |