alarm: prepare for syscall interruption implementation

Move alarm cancellation logic to a separate function
cancel_alarm_ll(). This fucntion will be called on
thread destruction to avoid post-mortem alarms.

Also move alarm scheduling logic to a separate function
set_alarm_ll() to make code symmetric.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
msleep: prepare for interruptible sleep implementation

synch_port::msleep: merge time-out and non-time-out cases
into one conditional branch to avoid code duplication.

This both simplifies the code and makes future implementation of
interruption handling code for interruptable sleeps easier.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
wait_until: introduce infrastructure for interruptible wait

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
msleep: wait in interruptible manner

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
alarm: wake threads in interruptible sleep

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tst-kill: add tests for interrupted syscalls (SIG_ALRM)

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
netperf: drop patch for limited alarm() implementation workaround

This patch is not needed anymore since alarm() implementation was
extended with missing features.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>