2024-08-25 04:08:24 +00:00
|
|
|
#include <QSemaphore>
|
|
|
|
#include <QSemaphoreReleaser>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qsemaphore.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qsemaphore.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QSemaphore_new(QSemaphore** outptr_QSemaphore) {
|
|
|
|
QSemaphore* ret = new QSemaphore();
|
|
|
|
*outptr_QSemaphore = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QSemaphore_new2(int n, QSemaphore** outptr_QSemaphore) {
|
|
|
|
QSemaphore* ret = new QSemaphore(static_cast<int>(n));
|
|
|
|
*outptr_QSemaphore = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QSemaphore_Acquire(QSemaphore* self) {
|
|
|
|
self->acquire();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QSemaphore_TryAcquire(QSemaphore* self) {
|
|
|
|
return self->tryAcquire();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QSemaphore_TryAcquire2(QSemaphore* self, int n, int timeout) {
|
|
|
|
return self->tryAcquire(static_cast<int>(n), static_cast<int>(timeout));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QSemaphore_Release(QSemaphore* self) {
|
|
|
|
self->release();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QSemaphore_Available(const QSemaphore* self) {
|
|
|
|
return self->available();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QSemaphore_Acquire1(QSemaphore* self, int n) {
|
|
|
|
self->acquire(static_cast<int>(n));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QSemaphore_TryAcquire1(QSemaphore* self, int n) {
|
|
|
|
return self->tryAcquire(static_cast<int>(n));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QSemaphore_Release1(QSemaphore* self, int n) {
|
|
|
|
self->release(static_cast<int>(n));
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QSemaphore_Delete(QSemaphore* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QSemaphore*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QSemaphoreReleaser_new(QSemaphoreReleaser** outptr_QSemaphoreReleaser) {
|
|
|
|
QSemaphoreReleaser* ret = new QSemaphoreReleaser();
|
|
|
|
*outptr_QSemaphoreReleaser = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QSemaphoreReleaser_new2(QSemaphore* sem, QSemaphoreReleaser** outptr_QSemaphoreReleaser) {
|
|
|
|
QSemaphoreReleaser* ret = new QSemaphoreReleaser(*sem);
|
|
|
|
*outptr_QSemaphoreReleaser = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QSemaphoreReleaser_new3(QSemaphore* sem, QSemaphoreReleaser** outptr_QSemaphoreReleaser) {
|
|
|
|
QSemaphoreReleaser* ret = new QSemaphoreReleaser(sem);
|
|
|
|
*outptr_QSemaphoreReleaser = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QSemaphoreReleaser_new4(QSemaphore* sem, int n, QSemaphoreReleaser** outptr_QSemaphoreReleaser) {
|
|
|
|
QSemaphoreReleaser* ret = new QSemaphoreReleaser(*sem, static_cast<int>(n));
|
|
|
|
*outptr_QSemaphoreReleaser = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QSemaphoreReleaser_new5(QSemaphore* sem, int n, QSemaphoreReleaser** outptr_QSemaphoreReleaser) {
|
|
|
|
QSemaphoreReleaser* ret = new QSemaphoreReleaser(sem, static_cast<int>(n));
|
|
|
|
*outptr_QSemaphoreReleaser = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QSemaphoreReleaser_Swap(QSemaphoreReleaser* self, QSemaphoreReleaser* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSemaphore* QSemaphoreReleaser_Semaphore(const QSemaphoreReleaser* self) {
|
|
|
|
return self->semaphore();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QSemaphore* QSemaphoreReleaser_Cancel(QSemaphoreReleaser* self) {
|
|
|
|
return self->cancel();
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QSemaphoreReleaser_Delete(QSemaphoreReleaser* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QSemaphoreReleaser*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|