Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 21fddd4

Browse files
committed
Fix race condition in FileFetcher
1 parent c0fb38a commit 21fddd4

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

Common/Utils/include/CommonUtils/FileFetcher.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ class FileFetcher
104104
size_t mNFilesProc = 0;
105105
size_t mNFilesProcOK = 0;
106106
mutable std::mutex mMtx;
107+
std::mutex mMtxStop;
107108
std::thread mFetcherThread{};
108109

109110
ClassDefNV(FileFetcher, 1);

Common/Utils/src/FileFetcher.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ void FileFetcher::start()
196196
void FileFetcher::stop()
197197
{
198198
mRunning = false;
199+
std::lock_guard<std::mutex> lock(mMtxStop);
199200
if (mFetcherThread.joinable()) {
200201
mFetcherThread.join();
201202
}

0 commit comments

Comments
 (0)