From 29acd96aa880df507ca23b4eb45a16fe88eb9e00 Mon Sep 17 00:00:00 2001 From: art Date: Thu, 23 Mar 2000 14:44:37 +0000 Subject: [PATCH] use the new timeout interface for tsleep. --- sys/kern/kern_synch.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index f419350c8f7..ebb7199d205 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.21 2000/03/23 10:13:58 art Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.22 2000/03/23 14:44:37 art Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /*- @@ -378,8 +378,10 @@ tsleep(ident, priority, wmesg, timo) else *qp->sq_tailp = p; *(qp->sq_tailp = &p->p_forw) = 0; - if (timo) - timeout(endtsleep, (void *)p, timo); + if (timo) { + timeout_set(&p->p_sleep_to, endtsleep, p); + timeout_add(&p->p_sleep_to, timo); + } /* * We put ourselves on the sleep queue and start our timeout * before calling CURSIG, as we could stop there, and a wakeup @@ -424,7 +426,7 @@ resume: return (EWOULDBLOCK); } } else if (timo) - untimeout(endtsleep, (void *)p); + timeout_del(&p->p_sleep_to); if (catch && (sig != 0 || (sig = CURSIG(p)) != 0)) { #ifdef KTRACE if (KTRPOINT(p, KTR_CSW)) @@ -451,7 +453,7 @@ void endtsleep(arg) void *arg; { - register struct proc *p; + struct proc *p; int s; p = (struct proc *)arg; -- 2.20.1