]> Zhao Yanbai Git Server - minix.git/commit
libsys: make tickdelay(3) more reliable 46/3046/1
authorDavid van Moolenbroek <david@minix3.org>
Sat, 18 Jul 2015 07:52:27 +0000 (09:52 +0200)
committerDavid van Moolenbroek <david@minix3.org>
Sat, 8 Aug 2015 16:55:23 +0000 (16:55 +0000)
commite10ce184e45094288ff2e324f9aaa968a798c3f6
treef5d01901ca777b86381794c1b8e399ae67b3051d
parent8731fd1c47ee8fde0d0a707438278d0f8088cee2
libsys: make tickdelay(3) more reliable

Previously, there was a tiny chance that tickdelay(3) would return
early or that it would fail to reinstate a previous alarm.

- sys_setalarm(2) now returns TMR_NEVER instead of 0 for the time
  left if no previous alarm was set;
- sys_setalarm(2) now also returns the current time, to allow the
  caller to determine whether it got an alarm notification for the
  alarm it set or for a previous alarm that has just gone off;
- tickdelay(3) now makes use of these facilities.

Change-Id: Id4f8fe19a61ca8574f43131964e6f0317f613f49
minix/include/minix/ipc.h
minix/include/minix/syslib.h
minix/kernel/system/do_setalarm.c
minix/lib/libsys/sys_setalarm.c
minix/lib/libsys/tickdelay.c