parlib: Use a relative timer for abort_sysc The issue is that the timer goes off before the syscall could block. If the timer was very far in the past, such as due to a go test that put the alarm 30 seconds in the past, we would do N loops, each of which fires instantly, until we finally set an alarm for the future. Using a relative timer fixes that. Also, one second is a bit much - enough that an interactive user might notice and wonder if something is broken. Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
diff --git a/user/parlib/alarm.c b/user/parlib/alarm.c index 4878bf4..0e1b336 100644 --- a/user/parlib/alarm.c +++ b/user/parlib/alarm.c
@@ -478,7 +478,7 @@ * unblocking, or even has returned, but hasn't cancelled the alarm. * regardless, we request a new alarm (the uthread will cancel us one * way or another). */ - set_awaiter_inc(awaiter, 1000000); + set_awaiter_rel(awaiter, 10000); __set_alarm(awaiter); return; }