mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 01:18:37 +00:00
50 lines
1.5 KiB
C
50 lines
1.5 KiB
C
|
#ifndef GEN_QREADWRITELOCK_H
|
||
|
#define GEN_QREADWRITELOCK_H
|
||
|
|
||
|
#include <stdbool.h>
|
||
|
#include <stddef.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
extern "C" {
|
||
|
#endif
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
class QReadLocker;
|
||
|
class QReadWriteLock;
|
||
|
class QWriteLocker;
|
||
|
#else
|
||
|
typedef struct QReadLocker QReadLocker;
|
||
|
typedef struct QReadWriteLock QReadWriteLock;
|
||
|
typedef struct QWriteLocker QWriteLocker;
|
||
|
#endif
|
||
|
|
||
|
void QReadWriteLock_LockForRead(QReadWriteLock* self);
|
||
|
bool QReadWriteLock_TryLockForRead(QReadWriteLock* self);
|
||
|
bool QReadWriteLock_TryLockForReadWithTimeout(QReadWriteLock* self, int timeout);
|
||
|
void QReadWriteLock_LockForWrite(QReadWriteLock* self);
|
||
|
bool QReadWriteLock_TryLockForWrite(QReadWriteLock* self);
|
||
|
bool QReadWriteLock_TryLockForWriteWithTimeout(QReadWriteLock* self, int timeout);
|
||
|
void QReadWriteLock_Unlock(QReadWriteLock* self);
|
||
|
void QReadWriteLock_Delete(QReadWriteLock* self);
|
||
|
|
||
|
QReadLocker* QReadLocker_new(QReadWriteLock* readWriteLock);
|
||
|
void QReadLocker_Unlock(QReadLocker* self);
|
||
|
void QReadLocker_Relock(QReadLocker* self);
|
||
|
QReadWriteLock* QReadLocker_ReadWriteLock(QReadLocker* self);
|
||
|
void QReadLocker_Delete(QReadLocker* self);
|
||
|
|
||
|
QWriteLocker* QWriteLocker_new(QReadWriteLock* readWriteLock);
|
||
|
void QWriteLocker_Unlock(QWriteLocker* self);
|
||
|
void QWriteLocker_Relock(QWriteLocker* self);
|
||
|
QReadWriteLock* QWriteLocker_ReadWriteLock(QWriteLocker* self);
|
||
|
void QWriteLocker_Delete(QWriteLocker* self);
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
} /* extern C */
|
||
|
#endif
|
||
|
|
||
|
#endif
|