summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorMarkos Fountoulakis <44345837+mfundul@users.noreply.github.com>2021-02-08 17:38:40 +0200
committerGitHub <noreply@github.com>2021-02-08 17:38:40 +0200
commit9ba79d3a1aec40d66b2d9570ae51715b151461bd (patch)
tree2a44f9b3486197da7119f225cce7fec5431d8bec /collectors
parentd206b1684ff3799a2b1cad5583dd7684716a294f (diff)
Fix crash during shutdown of cgroups internal plugin. (#10614)
Diffstat (limited to 'collectors')
-rw-r--r--collectors/cgroups.plugin/sys_fs_cgroup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/collectors/cgroups.plugin/sys_fs_cgroup.c b/collectors/cgroups.plugin/sys_fs_cgroup.c
index 705c517355..df1f5f21a8 100644
--- a/collectors/cgroups.plugin/sys_fs_cgroup.c
+++ b/collectors/cgroups.plugin/sys_fs_cgroup.c
@@ -3937,9 +3937,10 @@ static void cgroup_main_cleanup(void *ptr) {
if (!discovery_thread.exited) {
info("stopping discovery thread worker");
- uv_mutex_unlock(&discovery_thread.mutex);
+ uv_mutex_lock(&discovery_thread.mutex);
discovery_thread.start_discovery = 1;
uv_cond_signal(&discovery_thread.cond_var);
+ uv_mutex_unlock(&discovery_thread.mutex);
}
while (!discovery_thread.exited && max > 0) {