summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 3173f75..e1c81ca 100644
--- a/internal.h
+++ b/internal.h
@@ -39,6 +39,27 @@ struct Rastertask
Primitive p;
};
+typedef struct Proctask Proctask;
+typedef struct Procpool Procpool;
+
+struct Proctask
+{
+ void (*fn)(void*);
+ void *arg;
+};
+
+struct Procpool
+{
+ ulong nprocs;
+ Ref issued;
+ Ref complete;
+
+ Channel *subq; /* task submission queue */
+ Channel *done; /* task completion signal */
+};
+
+extern Procpool *turbodrawingpool;
+
/* alloc */
void *emalloc(ulong);
void *erealloc(void*, ulong);
@@ -79,6 +100,12 @@ void memsetl(void*, ulong, usize);
/* nanosec */
uvlong nanosec(void);
+/* procpool */
+Procpool *mkprocpool(ulong);
+void procpoolexec(Procpool*, void(*)(void*), void*);
+void procpoolwait(Procpool*);
+void rmprocpool(Procpool*);
+
#define getpixel(fb, p) rastergetcolor(fb, p)
#define putpixel(fb, p, c) rasterputcolor(fb, p, c)
#define getdepth(fb, p) rastergetfloat(fb, p)