2024-08-25 04:08:24 +00:00
|
|
|
#include <QBasicMutex>
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QMutexLocker>
|
|
|
|
#include <QRecursiveMutex>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qmutex.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qmutex.h"
|
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
|
|
|
QBasicMutex* QBasicMutex_new() {
|
|
|
|
return new QBasicMutex();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QBasicMutex_Lock(QBasicMutex* self) {
|
|
|
|
self->lock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBasicMutex_Unlock(QBasicMutex* self) {
|
|
|
|
self->unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBasicMutex_TryLock(QBasicMutex* self) {
|
|
|
|
return self->tryLock();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBasicMutex_TryLock2(QBasicMutex* self) {
|
|
|
|
return self->try_lock();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBasicMutex_IsRecursive(QBasicMutex* self) {
|
|
|
|
return self->isRecursive();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBasicMutex_IsRecursive2(const QBasicMutex* self) {
|
|
|
|
return self->isRecursive();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QBasicMutex_Delete(QBasicMutex* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QBasicMutex*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QMutex* QMutex_new() {
|
|
|
|
return new QMutex();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QMutex* QMutex_new2(int mode) {
|
|
|
|
return new QMutex(static_cast<QMutex::RecursionMode>(mode));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMutex_virtbase(QMutex* src, QBasicMutex** outptr_QBasicMutex) {
|
|
|
|
*outptr_QBasicMutex = static_cast<QBasicMutex*>(src);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QMutex_Lock(QMutex* self) {
|
|
|
|
self->lock();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QMutex_TryLock(QMutex* self) {
|
|
|
|
return self->tryLock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMutex_Unlock(QMutex* self) {
|
|
|
|
self->unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QMutex_TryLock2(QMutex* self) {
|
|
|
|
return self->try_lock();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QMutex_IsRecursive(const QMutex* self) {
|
|
|
|
return self->isRecursive();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QMutex_TryLock1(QMutex* self, int timeout) {
|
|
|
|
return self->tryLock(static_cast<int>(timeout));
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QMutex_Delete(QMutex* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QMutex*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QRecursiveMutex* QRecursiveMutex_new() {
|
|
|
|
return new QRecursiveMutex();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QRecursiveMutex_Delete(QRecursiveMutex* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QRecursiveMutex*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QMutexLocker* QMutexLocker_new(QBasicMutex* m) {
|
|
|
|
return new QMutexLocker(m);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QMutexLocker* QMutexLocker_new2(QRecursiveMutex* m) {
|
|
|
|
return new QMutexLocker(m);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMutexLocker_Unlock(QMutexLocker* self) {
|
|
|
|
self->unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMutexLocker_Relock(QMutexLocker* self) {
|
|
|
|
self->relock();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMutex* QMutexLocker_Mutex(const QMutexLocker* self) {
|
|
|
|
return self->mutex();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QMutexLocker_Delete(QMutexLocker* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QMutexLocker*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|