From 92915087fd253244d323ff88cd97c54367689030 Mon Sep 17 00:00:00 2001 From: Aurelien ROUGEMONT Date: Tue, 26 Jul 2016 12:29:49 +0200 Subject: [PATCH] metadata: add comment about metadata functions use and threads safety Signed-off-by: Florian Forster --- src/meta_data.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 */ -- 2.30.2