Module Name:    src
Committed By:   riastradh
Date:           Sun May  3 04:05:00 UTC 2020

Modified Files:
        src/share/man/man9: condvar.9

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/share/man/man9/condvar.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/condvar.9
diff -u src/share/man/man9/condvar.9:1.23 src/share/man/man9/condvar.9:1.24
--- src/share/man/man9/condvar.9:1.23	Sun May  3 04:04:32 2020
+++ src/share/man/man9/condvar.9	Sun May  3 04:05:00 2020
@@ -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 @@ Consuming a resource:
 		    &res->mutex, &timeout, DEFAULT_TIMEOUT_EPSILON);
 		if (error) {
 			KASSERT(error == EWOULDBLOCK);
-			if (res->state != BUSY)
-				break;
 			mutex_exit(&res->mutex);
 			return ETIMEDOUT;
 		}

Reply via email to