chiark / gitweb /
basic: document that people shouldn't use refcnt.h without reason
authorLennart Poettering <lennart@poettering.net>
Wed, 26 Aug 2015 19:04:38 +0000 (21:04 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:19:06 +0000 (10:19 +0100)
refcnt.h only exists for cases where objects are simultaneously handled
by different threads. Otherwise it should not be used. The only case
where this applies is sd_bus, really, and pretty much none of our APIs,
since we do not claim thread-safety for them.

src/basic/refcnt.h

index 0502c20a2e50448028013341f150990f36e9d571..8a39d69fe4090cd1c49823b79de11be76cc6633e 100644 (file)
@@ -21,7 +21,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-/* A type-safe atomic refcounter */
+/* A type-safe atomic refcounter.
+ *
+ * DO NOT USE THIS UNLESS YOU ACTUALLY CARE ABOUT THREAD SAFETY! */
 
 typedef struct {
         volatile unsigned _value;