diff options
Diffstat (limited to 'sources/shiboken6/libshiboken/gilstate.h')
-rw-r--r-- | sources/shiboken6/libshiboken/gilstate.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sources/shiboken6/libshiboken/gilstate.h b/sources/shiboken6/libshiboken/gilstate.h new file mode 100644 index 000000000..abad9d955 --- /dev/null +++ b/sources/shiboken6/libshiboken/gilstate.h @@ -0,0 +1,33 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef GILSTATE_H +#define GILSTATE_H + +#include <shibokenmacros.h> +#include "sbkpython.h" + +namespace Shiboken +{ + +class LIBSHIBOKEN_API GilState +{ +public: + GilState(const GilState &) = delete; + GilState(GilState &&) = delete; + GilState &operator=(const GilState &) = delete; + GilState &operator=(GilState &&) = delete; + + GilState(); + ~GilState(); + void release(); + void abandon(); +private: + PyGILState_STATE m_gstate; + bool m_locked = false; +}; + +} // namespace Shiboken + +#endif // GILSTATE_H + |