Sun Sep 8 16:01:49 2013 UTC ()
Destroy the mutex too in destroy_completion.


(riastradh)
diff -r1.1.2.4 -r1.1.2.5 src/sys/external/bsd/drm2/include/linux/completion.h

cvs diff -r1.1.2.4 -r1.1.2.5 src/sys/external/bsd/drm2/include/linux/Attic/completion.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/include/linux/Attic/completion.h 2013/09/08 16:00:50 1.1.2.4
+++ src/sys/external/bsd/drm2/include/linux/Attic/completion.h 2013/09/08 16:01:49 1.1.2.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: completion.h,v 1.1.2.4 2013/09/08 16:00:50 riastradh Exp $ */ 1/* $NetBSD: completion.h,v 1.1.2.5 2013/09/08 16:01:49 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Taylor R. Campbell. 8 * by Taylor R. Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -68,26 +68,27 @@ init_completion(struct completion *compl @@ -68,26 +68,27 @@ init_completion(struct completion *compl
68 mutex_init(&completion->c_lock, MUTEX_DEFAULT, IPL_NONE); 68 mutex_init(&completion->c_lock, MUTEX_DEFAULT, IPL_NONE);
69 cv_init(&completion->c_cv, "lnxcmplt"); 69 cv_init(&completion->c_cv, "lnxcmplt");
70 completion->c_done = 0; 70 completion->c_done = 0;
71} 71}
72 72
73/* 73/*
74 * Destroy a completion object. 74 * Destroy a completion object.
75 */ 75 */
76static inline void 76static inline void
77destroy_completion(struct completion *completion) 77destroy_completion(struct completion *completion)
78{ 78{
79 KASSERT(!cv_has_waiters(&completion->c_cv)); 79 KASSERT(!cv_has_waiters(&completion->c_cv));
80 cv_destroy(&completion->c_cv); 80 cv_destroy(&completion->c_cv);
 81 mutex_destroy(&completion->c_lock);
81} 82}
82 83
83/* 84/*
84 * Notify one waiter of completion, but not any future ones. 85 * Notify one waiter of completion, but not any future ones.
85 */ 86 */
86static inline void 87static inline void
87complete(struct completion *completion) 88complete(struct completion *completion)
88{ 89{
89 90
90 mutex_enter(&completion->c_lock); 91 mutex_enter(&completion->c_lock);
91 92
92 /* If it's not open season, wake one waiter. */ 93 /* If it's not open season, wake one waiter. */
93 if (completion->c_done >= 0) { 94 if (completion->c_done >= 0) {