2024-10-20 05:21:03 +00:00
|
|
|
#include <QBasicMutex>
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QRecursiveMutex>
|
|
|
|
#include <qmutex.h>
|
|
|
|
#include "gen_qmutex.h"
|
2024-12-11 06:55:47 +00:00
|
|
|
|
|
|
|
#ifndef _Bool
|
|
|
|
#define _Bool bool
|
|
|
|
#endif
|
2024-10-20 05:21:03 +00:00
|
|
|
#include "_cgo_export.h"
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QBasicMutex* QBasicMutex_new() {
|
|
|
|
return new QBasicMutex();
|
2024-10-20 05:21:03 +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();
|
|
|
|
}
|
|
|
|
|
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-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QMutex* QMutex_new() {
|
|
|
|
return new QMutex();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMutex_virtbase(QMutex* src, QBasicMutex** outptr_QBasicMutex) {
|
|
|
|
*outptr_QBasicMutex = static_cast<QBasicMutex*>(src);
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QMutex_TryLock(QMutex* self) {
|
|
|
|
return self->try_lock();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QMutex_TryLockWithTimeout(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-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QRecursiveMutex* QRecursiveMutex_new() {
|
|
|
|
return new QRecursiveMutex();
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QRecursiveMutex_Lock(QRecursiveMutex* self) {
|
|
|
|
self->lock();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QRecursiveMutex_TryLock(QRecursiveMutex* self) {
|
|
|
|
return self->tryLock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QRecursiveMutex_Unlock(QRecursiveMutex* self) {
|
|
|
|
self->unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QRecursiveMutex_TryLock2(QRecursiveMutex* self) {
|
|
|
|
return self->try_lock();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QRecursiveMutex_TryLock1(QRecursiveMutex* self, int timeout) {
|
|
|
|
return self->tryLock(static_cast<int>(timeout));
|
|
|
|
}
|
|
|
|
|
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-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|