1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_VCL_INC_OPENGL_WATCHDOG_H
11 #define INCLUDED_VCL_INC_OPENGL_WATCHDOG_H
13 #include <sal/config.h>
14 #include <salhelper/thread.hxx>
18 struct WatchdogTimingsValues
20 /// delays to take various actions in 1/4 of a second increments.
22 int const mnAbortAfter
;
25 enum class WatchdogTimingMode
34 std::vector
<WatchdogTimingsValues
> maTimingValues
;
35 std::atomic
<bool> mbRelaxed
;
40 void setRelax(bool bRelaxed
)
45 WatchdogTimingsValues
const & getWatchdogTimingsValues(WatchdogTimingMode eMode
)
47 size_t index
= (eMode
== WatchdogTimingMode::SHADER_COMPILE
) ? 1 : 0;
48 index
= mbRelaxed
? index
+ 2 : index
;
50 return maTimingValues
[index
];
54 class OpenGLWatchdogThread
: private salhelper::Thread
56 OpenGLWatchdogThread();
57 virtual void execute() override
;
59 using salhelper::Thread::acquire
;
60 using salhelper::Thread::release
;
65 #endif // INCLUDED_VCL_INC_OPENGL_WATCHDOG_H
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */