aboutsummaryrefslogtreecommitdiff
path: root/builtins/datatypes.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-11 14:47:34 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-11 14:47:34 -0400
commit2ecb5fe885042ca6c25ee0a3e3da070ddec9e07e (patch)
treecdd7c7d1d51982d4074f76a1bccc522fbc8b5eee /builtins/datatypes.h
parent3bf8ea8e12a2728bf63968ca7b42359b089e318b (diff)
Add channels and threads
Diffstat (limited to 'builtins/datatypes.h')
-rw-r--r--builtins/datatypes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/builtins/datatypes.h b/builtins/datatypes.h
index b0f62d03..41a67a5e 100644
--- a/builtins/datatypes.h
+++ b/builtins/datatypes.h
@@ -4,6 +4,7 @@
#include <stdint.h>
#include <stdbool.h>
+#include <pthread.h>
#define ARRAY_LENGTH_BITS 42
#define ARRAY_FREE_BITS 6
@@ -57,4 +58,10 @@ typedef struct Range_s {
int64_t first, last, step;
} Range_t;
+typedef struct {
+ array_t items;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+} channel_t;
+
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0