1// qsemaphore.sip generated by MetaSIP 2// 3// This file is part of the QtCore Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QSemaphore 24{ 25%TypeHeaderCode 26#include <qsemaphore.h> 27%End 28 29public: 30 explicit QSemaphore(int n = 0); 31 ~QSemaphore(); 32 void acquire(int n = 1) /ReleaseGIL/; 33 bool tryAcquire(int n = 1); 34 bool tryAcquire(int n, int timeout) /ReleaseGIL/; 35 void release(int n = 1); 36 int available() const; 37 38private: 39 QSemaphore(const QSemaphore &); 40}; 41 42%If (Qt_5_10_0 -) 43 44class QSemaphoreReleaser /NoDefaultCtors/ 45{ 46%TypeHeaderCode 47#include <qsemaphore.h> 48%End 49 50public: 51 QSemaphoreReleaser(); 52 QSemaphoreReleaser(QSemaphore *sem, int n = 1); 53 ~QSemaphoreReleaser(); 54 void swap(QSemaphoreReleaser &other); 55 QSemaphore *semaphore() const; 56 QSemaphore *cancel(); 57}; 58 59%End 60