diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2013-08-27 00:05:37 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2013-08-27 00:05:37 +0000 |
commit | 96c3c812fff7fb92640193399532d6cce7e35bae (patch) | |
tree | f241a9c541bc214c831e58cdb64ec6d92dd36a6f /sys | |
parent | e9f4bf1da1af81716733684468d927489693c23c (diff) |
make scsi_sem_leave only run again once, no matter how many times
other things scsi_sem_enter. the things protected by this do as
much work as they can, so they only need to be told to try again
once.
this isnt a semaphore anymore (and probably never was) so there's
a name change coming too.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/scsi/scsi_base.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index af7d6154cc4..c1fc1caef86 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.204 2013/08/26 01:37:13 dlg Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.205 2013/08/27 00:05:36 dlg Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -234,8 +234,10 @@ scsi_sem_leave(struct mutex *mtx, u_int *running) mtx_enter(mtx); (*running)--; - if ((*running) > 0) + if ((*running) > 0) { + (*running) = 1; rv = 0; + } mtx_leave(mtx); return (rv); |