From f9a2c8b929d4ed6bfed76c4a604b7e426468ba17 Mon Sep 17 00:00:00 2001 From: elbandi Date: Sat, 26 Apr 2014 00:46:01 +0200 Subject: [PATCH] Protect pool name with lock --- api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api.c b/api.c index da6e2fc6..50b75287 100644 --- a/api.c +++ b/api.c @@ -1818,7 +1818,9 @@ static void poolstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m lp = (char *)NO; root = api_add_int(root, "POOL", &i, false); - root = api_add_string(root, "Name", get_pool_name(pool), false); + mutex_lock(&pool->stratum_lock); + root = api_add_string(root, "Name", get_pool_name(pool), true); + mutex_unlock(&pool->stratum_lock); root = api_add_escape(root, "URL", pool->rpc_url, false); root = api_add_string(root, "Algorithm", pool->algorithm.name, false); root = api_add_string(root, "Description", pool->description, false);