miqt/qt6/gen_qmutex.cpp

87 lines
1.5 KiB
C++
Raw Normal View History

2024-10-20 18:21:03 +13:00
#include <QBasicMutex>
#include <QMutex>
#include <QRecursiveMutex>
#include <qmutex.h>
#include "gen_qmutex.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#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) {
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) {
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) {
delete self;
2024-10-20 18:21:03 +13:00
}