dirplex: Start children in the directory in which they were declared.
[ashd.git] / lib / mt.h
CommitLineData
ddf99192
FT
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
9struct 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
20struct muth *mustart(void (*fn)(struct muth *muth, va_list args), ...);
21void resume(struct muth *muth, int ret);
22int yield(void);
23
24extern struct muth *current;
25
26#endif