Fix typos
[TortoiseGit.git] / src / TGitCache / ShellUpdater.h
blob0adf708ad740b189aa6a113319a01d34305ee259
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2023 - TortoiseGit
4 // External Cache Copyright (C) 2005 - 2006 - Will Dean, Stefan Kueng
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
22 #include "TGitPath.h"
23 #include "SmartHandle.h"
25 /**
26 * \ingroup TGitCache
27 * Handles notifications to the shell about status changes. This is done
28 * in a separate thread to avoid deadlocks.
30 class CShellUpdater
32 public:
33 CShellUpdater();
34 ~CShellUpdater();
36 public:
37 void Initialise();
38 void AddPathForUpdate(const CTGitPath& path);
39 void Stop();
41 private:
42 static unsigned int __stdcall ThreadEntry(void* pContext);
43 void WorkerThread();
45 private:
46 CComAutoCriticalSection m_critSec;
47 CAutoGeneralHandle m_hThread;
48 std::deque<CTGitPath> m_pathsToUpdate;
49 CAutoGeneralHandle m_hTerminationEvent;
50 CAutoGeneralHandle m_hWakeEvent;
52 volatile bool m_bItemsAddedSinceLastUpdate = false;
53 volatile LONG m_bRunning = FALSE;