2024-11-17 06:21:37 +00:00
|
|
|
#pragma once
|
|
|
|
#ifndef MIQT_QT_GEN_QSEMAPHORE_H
|
|
|
|
#define MIQT_QT_GEN_QSEMAPHORE_H
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
#include "../libmiqt/libmiqt.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
class QSemaphore;
|
|
|
|
class QSemaphoreReleaser;
|
|
|
|
#else
|
|
|
|
typedef struct QSemaphore QSemaphore;
|
|
|
|
typedef struct QSemaphoreReleaser QSemaphoreReleaser;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
QSemaphore* QSemaphore_new();
|
|
|
|
QSemaphore* QSemaphore_new2(int n);
|
|
|
|
void QSemaphore_Acquire(QSemaphore* self);
|
|
|
|
bool QSemaphore_TryAcquire(QSemaphore* self);
|
|
|
|
bool QSemaphore_TryAcquire2(QSemaphore* self, int n, int timeout);
|
|
|
|
void QSemaphore_Release(QSemaphore* self);
|
2024-09-11 05:41:09 +00:00
|
|
|
int QSemaphore_Available(const QSemaphore* self);
|
2024-08-25 04:08:24 +00:00
|
|
|
void QSemaphore_Acquire1(QSemaphore* self, int n);
|
|
|
|
bool QSemaphore_TryAcquire1(QSemaphore* self, int n);
|
|
|
|
void QSemaphore_Release1(QSemaphore* self, int n);
|
|
|
|
void QSemaphore_Delete(QSemaphore* self);
|
|
|
|
|
|
|
|
QSemaphoreReleaser* QSemaphoreReleaser_new();
|
|
|
|
QSemaphoreReleaser* QSemaphoreReleaser_new2(QSemaphore* sem);
|
|
|
|
QSemaphoreReleaser* QSemaphoreReleaser_new3(QSemaphore* sem);
|
|
|
|
QSemaphoreReleaser* QSemaphoreReleaser_new4(QSemaphore* sem, int n);
|
|
|
|
QSemaphoreReleaser* QSemaphoreReleaser_new5(QSemaphore* sem, int n);
|
|
|
|
void QSemaphoreReleaser_Swap(QSemaphoreReleaser* self, QSemaphoreReleaser* other);
|
2024-09-11 05:41:09 +00:00
|
|
|
QSemaphore* QSemaphoreReleaser_Semaphore(const QSemaphoreReleaser* self);
|
2024-08-25 04:08:24 +00:00
|
|
|
QSemaphore* QSemaphoreReleaser_Cancel(QSemaphoreReleaser* self);
|
|
|
|
void QSemaphoreReleaser_Delete(QSemaphoreReleaser* self);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern C */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|