Page MenuHomeFreeBSD

D17616.id49312.diff
No OneTemporary

D17616.id49312.diff

Index: sys/sys/refcount.h
===================================================================
--- sys/sys/refcount.h
+++ sys/sys/refcount.h
@@ -77,14 +77,20 @@
}
/*
+ * This functions returns non-zero if the refcount was
+ * incremented. Else zero is returned.
+ *
* A temporary hack until refcount_* APIs are sorted out.
*/
-static __inline int
+static __inline __result_use_check int
refcount_acquire_if_not_zero(volatile u_int *count)
{
u_int old;
old = *count;
+
+ KASSERT(old < UINT_MAX, ("refcount %p overflowed", count));
+
for (;;) {
if (old == 0)
return (0);

File Metadata

Mime Type
text/plain
Expires
Tue, May 19, 1:51 AM (14 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33284558
Default Alt Text
D17616.id49312.diff (593 B)

Event Timeline