summaryrefslogtreecommitdiff
path: root/sys/dev/dt
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2021-02-08 08:18:46 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2021-02-08 08:18:46 +0000
commit362aba3e956af19d7f77275c98267534a66dff98 (patch)
tree3bebc5b78c6eb47c76fc8c754f72b9791ee9c107 /sys/dev/dt
parent426419f7326caf435b9834d7ee44b0ccfaa642e9 (diff)
Simplify sleep_setup API to two operations in preparation for splitting
the SCHED_LOCK(). Putting a thread on a sleep queue is reduce to the following: sleep_setup(); /* check condition or release lock */ sleep_finish(); Previous version ok cheloha@, jmatthew@, ok claudio@
Diffstat (limited to 'sys/dev/dt')
-rw-r--r--sys/dev/dt/dt_dev.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/dt/dt_dev.c b/sys/dev/dt/dt_dev.c
index 51dc5e1cd81..bf96200b1a6 100644
--- a/sys/dev/dt/dt_dev.c
+++ b/sys/dev/dt/dt_dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dt_dev.c,v 1.10 2020/09/28 13:16:58 kettenis Exp $ */
+/* $OpenBSD: dt_dev.c,v 1.11 2021/02/08 08:18:45 mpi Exp $ */
/*
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
@@ -225,10 +225,8 @@ dtread(dev_t dev, struct uio *uio, int flags)
return (EMSGSIZE);
while (!sc->ds_evtcnt) {
- sleep_setup(&sls, sc, PWAIT | PCATCH, "dtread");
- sleep_setup_signal(&sls);
- sleep_finish(&sls, !sc->ds_evtcnt);
- error = sleep_finish_signal(&sls);
+ sleep_setup(&sls, sc, PWAIT | PCATCH, "dtread", 0);
+ error = sleep_finish(&sls, !sc->ds_evtcnt);
if (error == EINTR || error == ERESTART)
break;
}