projects
/
jump.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
dol: add support for iterated ports and processes
[jump.git]
/
dol
/
examples
/
examplesingleprocess
/
src
/
task.c
1
#include <stdio.h>
2
3
#include "task.h"
4
5
void task_init(DOLProcess *p) {
6
sprintf(p->local->name, "task_%d", GETINDEX(0));
7
p->local->index = 0;
8
}
9
10
int task_fire(DOLProcess *p) {
11
if (p->local->index < 10) {
12
printf("%s: %d\n", p->local->name, p->local->index++);
13
}
14
15
if (p->local->index >= 10) {
16
DOL_detach(p);
17
}
18
19
return 0;
20
}
21