From 4319dedb239e65f16a0ec21153eae0a534e9b5da Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 22 Dec 2017 12:02:44 +0100 Subject: [PATCH] db/update/Walk: use std::atomic_bool for the "quit" variable Fixes thread sanitizer warnings. --- src/db/update/Walk.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/db/update/Walk.hxx b/src/db/update/Walk.hxx index cdc42f4b8..151cdf957 100644 --- a/src/db/update/Walk.hxx +++ b/src/db/update/Walk.hxx @@ -24,6 +24,8 @@ #include "Editor.hxx" #include "Compiler.h" +#include + struct StorageFileInfo; struct Directory; struct ArchivePlugin; @@ -52,7 +54,7 @@ class UpdateWalk final { * cancel as quickly as possible. Access to this flag is * unprotected. */ - volatile bool cancel; + std::atomic_bool cancel; Storage &storage;