Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/man/man9 Simplify example of cv_timedwaitbt.



details:   https://anonhg.NetBSD.org/src/rev/9ac973b83d27
branches:  trunk
changeset: 932245:9ac973b83d27
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun May 03 04:05:00 2020 +0000

description:
Simplify example of cv_timedwaitbt.

It is simpler if there is only one place we check the condition.

That said, there are cases where the caller needs to re-check before
choosing to fail (e.g., futex_wait in kern/sys_futex.c, which must
verify the condition before taking destructive steps to abort the
wait).  But it's not clear that that's the norm.

diffstat:

 share/man/man9/condvar.9 |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (18 lines):

diff -r 7a0145b45a36 -r 9ac973b83d27 share/man/man9/condvar.9
--- a/share/man/man9/condvar.9  Sun May 03 04:04:32 2020 +0000
+++ b/share/man/man9/condvar.9  Sun May 03 04:05:00 2020 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: condvar.9,v 1.23 2020/05/03 04:04:32 riastradh Exp $
+.\"    $NetBSD: condvar.9,v 1.24 2020/05/03 04:05:00 riastradh Exp $
 .\"
 .\" Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -305,8 +305,6 @@
                    &res->mutex, &timeout, DEFAULT_TIMEOUT_EPSILON);
                if (error) {
                        KASSERT(error == EWOULDBLOCK);
-                       if (res->state != BUSY)
-                               break;
                        mutex_exit(&res->mutex);
                        return ETIMEDOUT;
                }



Home | Main Index | Thread Index | Old Index