source:
src/examples/multicore.c
@
a7c4921
Last change on this file since a7c4921 was 9e45e46, checked in by , 7 years ago | |
---|---|
|
|
File size: 442 bytes |
Rev | Line | |
---|---|---|
[8d4f7fe] | 1 | #include <kernel> |
2 | #include <threads> | |
3 | ||
4 | struct MyThread { thread t; }; | |
5 | ||
6 | DECL_THREAD(MyThread); | |
7 | ||
8 | void ?{}( MyThread * this ) {} | |
9 | ||
10 | void main( MyThread* this ) { | |
[9e45e46] | 11 | for(int i = 0; i < 1000000; i++) { |
[8d4f7fe] | 12 | yield(); |
13 | } | |
14 | } | |
15 | ||
16 | int main(int argc, char* argv[]) { | |
[9e45e46] | 17 | // sout | "User main begin" | endl; |
[8d4f7fe] | 18 | { |
19 | processor p; | |
20 | { | |
21 | scoped(MyThread) f1; | |
22 | scoped(MyThread) f2; | |
23 | scoped(MyThread) f3; | |
24 | scoped(MyThread) f4; | |
25 | } | |
26 | } | |
[9e45e46] | 27 | // sout | "User main end" | endl; |
[8d4f7fe] | 28 | } |
Note: See TracBrowser
for help on using the repository browser.