Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/common/include/linux linux: wait_for_comple...
details: https://anonhg.NetBSD.org/src/rev/efff88a466a9
branches: trunk
changeset: 1028877:efff88a466a9
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 12:22:56 2021 +0000
description:
linux: wait_for_completion
diffstat:
sys/external/bsd/common/include/linux/completion.h | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diffs (27 lines):
diff -r f34ef2512b66 -r efff88a466a9 sys/external/bsd/common/include/linux/completion.h
--- a/sys/external/bsd/common/include/linux/completion.h Sun Dec 19 12:22:48 2021 +0000
+++ b/sys/external/bsd/common/include/linux/completion.h Sun Dec 19 12:22:56 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: completion.h,v 1.10 2021/12/19 01:57:42 riastradh Exp $ */
+/* $NetBSD: completion.h,v 1.11 2021/12/19 12:22:56 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -306,6 +306,17 @@
return wait_for_completion_interruptible(completion);
}
+static inline void
+wait_for_completion(struct completion *completion)
+{
+
+ mutex_enter(&completion->c_lock);
+ while (completion->c_done == 0)
+ cv_wait(&completion->c_cv, &completion->c_lock);
+ _completion_claim(completion);
+ mutex_exit(&completion->c_lock);
+}
+
/*
* Try to claim a completion immediately. Return true on success, false
* if it would block.
Home |
Main Index |
Thread Index |
Old Index