Updated ChangeLog.
[ashd.git] / lib / mt.h
1 #ifndef _MUTHREAD_H
2 #define _MUTHREAD_H
3
4 #include <ucontext.h>
5 #include <stdarg.h>
6
7 #define vavar(type, name) type name = va_arg(args, type)
8
9 struct muth {
10     ucontext_t ctxt, *last;
11     void *stack;
12     void (*entry)(struct muth *muth, va_list args);
13     va_list *arglist;
14     int running;
15     int yr;
16     int freeme;
17     int vgid;
18 };
19
20 struct muth *mustart(void (*fn)(struct muth *muth, va_list args), ...);
21 void resume(struct muth *muth, int ret);
22 int yield(void);
23
24 extern struct muth *current;
25
26 #endif