summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2026-01-02 12:56:28 +0100
committerAndreas Fankhauser hiddenalpha.ch2026-01-02 12:56:28 +0100
commit994939ab62c28bb0e7c180b4fff085bdf9d00256 (patch)
treeaca37129de749a0a990e3ed6a5fed037eda04252
parent98d511c55fe8e37ce571fd11c3532a4d533aabbd (diff)
downloadQntan-994939ab62c28bb0e7c180b4fff085bdf9d00256.tar.gz
Qntan-994939ab62c28bb0e7c180b4fff085bdf9d00256.zip
Add Mutx/Cond method macros
-rw-r--r--include/qntan/Qntan.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h
index e0bfab7..27d36df 100644
--- a/include/qntan/Qntan.h
+++ b/include/qntan/Qntan.h
@@ -806,6 +806,16 @@ struct Qntan_TarDec {
+#ifndef Qntan_Cond_wait
+# define Qntan_Cond_wait(A, ...) (*(A))->wait(A, __VA_ARGS__)
+#endif
+#ifndef Qntan_Cond_bcast
+# define Qntan_Cond_bcast(A) (*(A))->bcast(A)
+#endif
+#ifndef Qntan_Cond_signal
+# define Qntan_Cond_signal(A) (*(A))->signal(A)
+#endif
+/**/
struct Qntan_Cond {
/* An asynchronous Conditional-Variable.
*/
@@ -833,6 +843,13 @@ struct Qntan_Cond {
+#ifndef Qntan_Mutx_lock
+# define Qntan_Mutx_lock(A) (*(A))->lock(A)
+#endif
+#ifndef Qntan_Mutx_unlock
+# define Qntan_Mutx_unlock(A) (*(A))->unlock(A)
+#endif
+/**/
struct Qntan_Mutx {
/* Same idea as a `pthread_mutex_t`, just using virtual funcs, to
* increase overkill and make some people sad :D