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_OPENCL_INC_OPENCL_ZONE_HXX
11 #define INCLUDED_OPENCL_INC_OPENCL_ZONE_HXX
13 #include <sal/config.h>
18 #include <opencl/opencldllapi.h>
20 // FIXME: post back-port, templatize me and share with OpenGLZone.
21 class OPENCL_DLLPUBLIC OpenCLZone
23 /// how many times have we entered a CL zone and not yet left it
24 static volatile std::sig_atomic_t gnEnterCount
;
25 static volatile bool gbInInitialTest
;
30 gnEnterCount
= gnEnterCount
+ 1; //TODO: overflow
35 // coverity[assert_side_effect]
36 assert(gnEnterCount
> 0);
37 gnEnterCount
= gnEnterCount
- 1;
39 gbInInitialTest
= false;
42 static bool isInZone()
44 return gnEnterCount
> 0;
47 static bool isInInitialTest()
49 return gbInInitialTest
;
52 static void hardDisable();
53 static void enterInitialTest();
56 #endif // INCLUDED_OPENCL_INC_OPENCL_ZONE_HXX
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */