/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.23
 *
 * Copyright (c) 2020 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtCore.h"

#line 57 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/sip/QtCore/qmutex.sip"
#include <qmutex.h>
#line 29 "/scratch/jenkins-BUILDS-eSDK-2023.1_stable-pipeline-build_async-47_k26_smk_kv_full/build/tmp/work/cortexa72-cortexa53-xilinx-linux/python3-pyqt5/5.15.1-r0/PyQt5-5.15.1/QtCore/sipQtCoreQMutex.cpp"



PyDoc_STRVAR(doc_QMutex_lock, "lock(self)");

extern "C" {static PyObject *meth_QMutex_lock(PyObject *, PyObject *);}
static PyObject *meth_QMutex_lock(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QMutex *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QMutex, &sipCpp))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->lock();
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QMutex, sipName_lock, doc_QMutex_lock);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMutex_tryLock, "tryLock(self, timeout: int = 0) -> bool");

extern "C" {static PyObject *meth_QMutex_tryLock(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_QMutex_tryLock(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0 = 0;
         ::QMutex *sipCpp;

        static const char *sipKwdList[] = {
            sipName_timeout,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|i", &sipSelf, sipType_QMutex, &sipCpp, &a0))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->tryLock(a0);
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMutex, sipName_tryLock, doc_QMutex_tryLock);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMutex_unlock, "unlock(self)");

extern "C" {static PyObject *meth_QMutex_unlock(PyObject *, PyObject *);}
static PyObject *meth_QMutex_unlock(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QMutex *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QMutex, &sipCpp))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->unlock();
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QMutex, sipName_unlock, doc_QMutex_unlock);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMutex_isRecursive, "isRecursive(self) -> bool");

extern "C" {static PyObject *meth_QMutex_isRecursive(PyObject *, PyObject *);}
static PyObject *meth_QMutex_isRecursive(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QMutex *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QMutex, &sipCpp))
        {
            bool sipRes;

            sipRes = sipCpp->isRecursive();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMutex, sipName_isRecursive, doc_QMutex_isRecursive);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QMutex(void *, int);}
static void release_QMutex(void *sipCppV, int)
{
    delete reinterpret_cast< ::QMutex *>(sipCppV);
}


extern "C" {static void *array_QMutex(Py_ssize_t);}
static void *array_QMutex(Py_ssize_t sipNrElem)
{
    return new  ::QMutex[sipNrElem];
}


extern "C" {static void dealloc_QMutex(sipSimpleWrapper *);}
static void dealloc_QMutex(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_QMutex(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_QMutex(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QMutex(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::QMutex *sipCpp = SIP_NULLPTR;

    {
         ::QMutex::RecursionMode a0 = QMutex::NonRecursive;

        static const char *sipKwdList[] = {
            sipName_mode,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|E", sipType_QMutex_RecursionMode, &a0))
        {
            sipCpp = new  ::QMutex(a0);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QMutex[] = {
    {SIP_MLNAME_CAST(sipName_isRecursive), meth_QMutex_isRecursive, METH_VARARGS, SIP_MLDOC_CAST(doc_QMutex_isRecursive)},
    {SIP_MLNAME_CAST(sipName_lock), meth_QMutex_lock, METH_VARARGS, SIP_MLDOC_CAST(doc_QMutex_lock)},
    {SIP_MLNAME_CAST(sipName_tryLock), SIP_MLMETH_CAST(meth_QMutex_tryLock), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_QMutex_tryLock)},
    {SIP_MLNAME_CAST(sipName_unlock), meth_QMutex_unlock, METH_VARARGS, SIP_MLDOC_CAST(doc_QMutex_unlock)}
};

static sipEnumMemberDef enummembers_QMutex[] = {
    {sipName_NonRecursive, static_cast<int>( ::QMutex::NonRecursive), 189},
    {sipName_Recursive, static_cast<int>( ::QMutex::Recursive), 189},
};

PyDoc_STRVAR(doc_QMutex, "\1QMutex(mode: QMutex.RecursionMode = QMutex.NonRecursive)");


static pyqt5ClassPluginDef plugin_QMutex = {
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtCore_QMutex = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QMutex,
        {SIP_NULLPTR},
        &plugin_QMutex
    },
    {
        sipNameNr_QMutex,
        {0, 0, 1},
        4, methods_QMutex,
        2, enummembers_QMutex,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QMutex,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QMutex,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_QMutex,
    SIP_NULLPTR,
    array_QMutex,
    SIP_NULLPTR,
    release_QMutex,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
