From 93dcc0349fa1dd91707e8917865fb8da116147d1 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 30 May 2022 19:41:41 -0300 Subject: [PATCH] Fix warning by ThreadSanitizer in HttpLoader --- laf | 2 +- src/app/res/http_loader.cpp | 4 ++-- src/app/res/http_loader.h | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/laf b/laf index 2d71ca692..68a447419 160000 --- a/laf +++ b/laf @@ -1 +1 @@ -Subproject commit 2d71ca692a60f50312b07f0521a0ffb5c3c9e32f +Subproject commit 68a44741998e5a769a9b952ddb422e993dc5b6a9 diff --git a/src/app/res/http_loader.cpp b/src/app/res/http_loader.cpp index f2a82c39a..7e7455848 100644 --- a/src/app/res/http_loader.cpp +++ b/src/app/res/http_loader.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2020 Igara Studio S.A. +// Copyright (C) 2020-2022 Igara Studio S.A. // Copyright (C) 2001-2016 David Capello // // This program is distributed under the terms of @@ -46,7 +46,7 @@ void HttpLoader::abort() void HttpLoader::threadHttpRequest() { try { - base::ScopedValue scoped(m_done, false, true); + base::ScopedValue, bool> scoped(m_done, false, true); LOG("HTTP: Sending http request to %s\n", m_url.c_str()); diff --git a/src/app/res/http_loader.h b/src/app/res/http_loader.h index d9badcb5b..abe14e8e9 100644 --- a/src/app/res/http_loader.h +++ b/src/app/res/http_loader.h @@ -1,4 +1,5 @@ // Aseprite +// Copyright (C) 2022 Igara Studio S.A. // Copyright (C) 2001-2016 David Capello // // This program is distributed under the terms of @@ -9,6 +10,8 @@ #pragma once #include "base/thread.h" + +#include #include namespace net { @@ -30,7 +33,7 @@ namespace app { void threadHttpRequest(); std::string m_url; - bool m_done; + std::atomic m_done; net::HttpRequest* m_request; base::thread m_thread; std::string m_filename;