alarm: Do not allow callbacks to block
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 2 Nov 2018 02:34:17 +0000 (22:34 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 2 Nov 2018 02:34:17 +0000 (22:34 -0400)
commitf89b6d306593e2ab3e6ea7d6e73ece090c44b176
tree04560a000b281218bc281e010977d3d3a45d5cfd
parent45d47a9f3253bb96ce6eb657eba2e1c90cbf4975
alarm: Do not allow callbacks to block

This isn't perfect, but it will catch any alarm callbacks that *attempt*
to block.

We have a bunch of issues with alarms.  One of them that affects
userspace, but not the kernel, is alarms that block will delay the
execution of other alarms.  Right now, the kernel just sends kernel
messages, so it's not a big deal.

In upcoming patches, I'm going to need to run all of the alarms in
closer coordination with the tchain so that I can safely tell if unset
works - specifically, the tchain will track which alarm it's running.
To do that, we'll need to serialize alarms on a tchain, which means if
an alarm blocks, it might block all future alarms.  That could deadlock.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/alarm.c