From: Aurelien ROUGEMONT Date: Tue, 26 Jul 2016 10:29:49 +0000 (+0200) Subject: metadata: add comment about metadata functions use and threads safety X-Git-Tag: collectd-5.6.0~3^2~9^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=92915087fd253244d323ff88cd97c54367689030;p=collectd.git metadata: add comment about metadata functions use and threads safety Signed-off-by: Florian Forster --- diff --git a/src/meta_data.c b/src/meta_data.c index 0fc58ff5..d2207843 100644 --- a/src/meta_data.c +++ b/src/meta_data.c @@ -208,6 +208,17 @@ static meta_entry_t *md_entry_lookup (meta_data_t *md, /* {{{ */ return (e); } /* }}} meta_entry_t *md_entry_lookup */ +/* + * Each value_list_t*, as it is going through the system, is handled by exactly + * one thread. Plugins which pass a value_list_t* to another thread, e.g. the + * rrdtool plugin, must create a copy first. The meta data within a + * value_list_t* is not thread safe and doesn't need to be. + * + * The meta data associated with cache entries are a different story. There, we + * need to ensure exclusive locking to prevent leaks and other funky business. + * This is ensured by the uc_meta_data_get_*() functions. + */ + /* * Public functions */