source:
src/examples/multicore.c
@
d92ff4a
Last change on this file since d92ff4a was 17af7d1, checked in by , 8 years ago | |
---|---|
|
|
File size: 381 bytes |
Rev | Line | |
---|---|---|
[8d4f7fe] | 1 | #include <kernel> |
[4a3334cf] | 2 | #include <thread> |
[8d4f7fe] | 3 | |
[17af7d1] | 4 | struct MyThread { thread_desc __thrd; }; |
[8d4f7fe] | 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 | { | |
[9013eb0] | 21 | scoped(MyThread) f[4]; |
[8d4f7fe] | 22 | } |
23 | } | |
[9e45e46] | 24 | // sout | "User main end" | endl; |
[8d4f7fe] | 25 | } |
Note: See TracBrowser
for help on using the repository browser.