2024-08-25 04:08:24 +00:00
|
|
|
#include <QReadLocker>
|
|
|
|
#include <QReadWriteLock>
|
|
|
|
#include <QWriteLocker>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qreadwritelock.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qreadwritelock.h"
|
2024-12-11 06:55:47 +00:00
|
|
|
|
|
|
|
#ifndef _Bool
|
|
|
|
#define _Bool bool
|
|
|
|
#endif
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QReadWriteLock* QReadWriteLock_new() {
|
|
|
|
return new QReadWriteLock();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QReadWriteLock* QReadWriteLock_new2(int recursionMode) {
|
|
|
|
return new QReadWriteLock(static_cast<QReadWriteLock::RecursionMode>(recursionMode));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QReadWriteLock_LockForRead(QReadWriteLock* self) {
|
|
|
|
self->lockForRead();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QReadWriteLock_TryLockForRead(QReadWriteLock* self) {
|
|
|
|
return self->tryLockForRead();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QReadWriteLock_TryLockForReadWithTimeout(QReadWriteLock* self, int timeout) {
|
|
|
|
return self->tryLockForRead(static_cast<int>(timeout));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QReadWriteLock_LockForWrite(QReadWriteLock* self) {
|
|
|
|
self->lockForWrite();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QReadWriteLock_TryLockForWrite(QReadWriteLock* self) {
|
|
|
|
return self->tryLockForWrite();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QReadWriteLock_TryLockForWriteWithTimeout(QReadWriteLock* self, int timeout) {
|
|
|
|
return self->tryLockForWrite(static_cast<int>(timeout));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QReadWriteLock_Unlock(QReadWriteLock* self) {
|
|
|
|
self->unlock();
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QReadWriteLock_Delete(QReadWriteLock* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QReadWriteLock*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QReadLocker* QReadLocker_new(QReadWriteLock* readWriteLock) {
|
|
|
|
return new QReadLocker(readWriteLock);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QReadLocker_Unlock(QReadLocker* self) {
|
|
|
|
self->unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QReadLocker_Relock(QReadLocker* self) {
|
|
|
|
self->relock();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QReadWriteLock* QReadLocker_ReadWriteLock(const QReadLocker* self) {
|
|
|
|
return self->readWriteLock();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QReadLocker_Delete(QReadLocker* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QReadLocker*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QWriteLocker* QWriteLocker_new(QReadWriteLock* readWriteLock) {
|
|
|
|
return new QWriteLocker(readWriteLock);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QWriteLocker_Unlock(QWriteLocker* self) {
|
|
|
|
self->unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QWriteLocker_Relock(QWriteLocker* self) {
|
|
|
|
self->relock();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QReadWriteLock* QWriteLocker_ReadWriteLock(const QWriteLocker* self) {
|
|
|
|
return self->readWriteLock();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QWriteLocker_Delete(QWriteLocker* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QWriteLocker*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|