4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2012 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #ifndef XCSOAR_PROTECTION_HPP
25 #define XCSOAR_PROTECTION_HPP
27 #include "Thread/Flag.hpp"
28 #include "Thread/Mutex.hpp"
31 * Notify the #MergeThread that new data has arrived in the
37 void TriggerGPSUpdate();
38 void TriggerVarioUpdate();
41 * Trigger a redraw of the map window.
47 * Called by the calculation thread when new calculation results are
48 * available. This updates the map and the info boxes.
51 TriggerCalculatedUpdate();
53 void CreateCalculationThread();
55 // changed only in config or by user interface
56 // used in settings dialog
57 extern bool DevicePortChanged
;
58 extern bool AirspaceFileChanged
;
59 extern bool WaypointFileChanged
;
60 extern bool TerrainFileChanged
;
61 extern bool AirfieldFileChanged
;
62 extern bool TopographyFileChanged
;
63 extern bool PolarFileChanged
;
64 extern bool LanguageFileChanged
;
65 extern bool StatusFileChanged
;
66 extern bool InputFileChanged
;
67 extern bool MapFileChanged
;
68 extern bool LanguageChanged
;
70 extern Flag globalRunningEvent
;
73 * Suspend all threads which have unprotected access to shared data.
74 * Call this before doing write operations on shared data.
80 * Resume all threads suspended by SuspendAllThreads().
85 class ScopeSuspendAllThreads
{
87 ScopeSuspendAllThreads() { SuspendAllThreads(); }
88 ~ScopeSuspendAllThreads() { ResumeAllThreads(); }