2024-10-20 18:21:03 +13:00
|
|
|
#include <QBasicMutex>
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QRecursiveMutex>
|
|
|
|
#include <qmutex.h>
|
|
|
|
#include "gen_qmutex.h"
|
2024-12-11 19:55:47 +13:00
|
|
|
|
2025-01-07 11:30:33 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern C */
|
2024-12-11 19:55:47 +13:00
|
|
|
#endif
|
2024-10-20 18:21:03 +13:00
|
|
|
|
2024-12-07 17:15:57 +13:00
|
|
|
QBasicMutex* QBasicMutex_new() {
|
|
|
|
return new QBasicMutex();
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
void QBasicMutex_lock(QBasicMutex* self) {
|
2024-10-20 18:21:03 +13:00
|
|
|
self->lock();
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
void QBasicMutex_unlock(QBasicMutex* self) {
|
2024-10-20 18:21:03 +13:00
|
|
|
self->unlock();
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
bool QBasicMutex_tryLock(QBasicMutex* self) {
|
2024-10-20 18:21:03 +13:00
|
|
|
return self->tryLock();
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
bool QBasicMutex_tryLock2(QBasicMutex* self) {
|
2024-10-20 18:21:03 +13:00
|
|
|
return self->try_lock();
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
void QBasicMutex_delete(QBasicMutex* self) {
|
2025-01-18 17:42:41 +13:00
|
|
|
delete self;
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
2024-12-07 17:15:57 +13:00
|
|
|
QMutex* QMutex_new() {
|
|
|
|
return new QMutex();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMutex_virtbase(QMutex* src, QBasicMutex** outptr_QBasicMutex) {
|
|
|
|
*outptr_QBasicMutex = static_cast<QBasicMutex*>(src);
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
bool QMutex_tryLock(QMutex* self) {
|
2024-10-20 18:21:03 +13:00
|
|
|
return self->try_lock();
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
bool QMutex_tryLockWithTimeout(QMutex* self, int timeout) {
|
2024-10-20 18:21:03 +13:00
|
|
|
return self->tryLock(static_cast<int>(timeout));
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
void QMutex_delete(QMutex* self) {
|
2025-01-18 17:42:41 +13:00
|
|
|
delete self;
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
2024-12-07 17:15:57 +13:00
|
|
|
QRecursiveMutex* QRecursiveMutex_new() {
|
|
|
|
return new QRecursiveMutex();
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
void QRecursiveMutex_lock(QRecursiveMutex* self) {
|
2024-10-20 18:21:03 +13:00
|
|
|
self->lock();
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
bool QRecursiveMutex_tryLock(QRecursiveMutex* self) {
|
2024-10-20 18:21:03 +13:00
|
|
|
return self->tryLock();
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
void QRecursiveMutex_unlock(QRecursiveMutex* self) {
|
2024-10-20 18:21:03 +13:00
|
|
|
self->unlock();
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
bool QRecursiveMutex_tryLock2(QRecursiveMutex* self) {
|
2024-10-20 18:21:03 +13:00
|
|
|
return self->try_lock();
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
bool QRecursiveMutex_tryLock1(QRecursiveMutex* self, int timeout) {
|
2024-10-20 18:21:03 +13:00
|
|
|
return self->tryLock(static_cast<int>(timeout));
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
void QRecursiveMutex_delete(QRecursiveMutex* self) {
|
2025-01-18 17:42:41 +13:00
|
|
|
delete self;
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|