summaryrefslogtreecommitdiff
path: root/core/upb_atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/upb_atomic.h')
-rw-r--r--core/upb_atomic.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/upb_atomic.h b/core/upb_atomic.h
index 01fc8a2..1cd848b 100644
--- a/core/upb_atomic.h
+++ b/core/upb_atomic.h
@@ -127,6 +127,10 @@ INLINE bool upb_atomic_unref(upb_atomic_refcount_t *a) {
Implement them or compile with UPB_THREAD_UNSAFE.
#endif
+INLINE bool upb_atomic_only(upb_atomic_refcount_t *a) {
+ return upb_atomic_read(a) == 1;
+}
+
/* Reader/Writer lock. ********************************************************/
#ifdef UPB_THREAD_UNSAFE
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback