source: src/examples/multicore.c @ 75a17f1

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 75a17f1 was 9013eb0, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

Updated multicore example to use array instead of name variables

  • Property mode set to 100644
File size: 372 bytes
RevLine 
[8d4f7fe]1#include <kernel>
2#include <threads>
3
4struct MyThread { thread t; };
5
6DECL_THREAD(MyThread);
7
8void ?{}( MyThread * this ) {}
9
10void main( MyThread* this ) {
[9e45e46]11        for(int i = 0; i < 1000000; i++) {
[8d4f7fe]12                yield();
13        }
14}
15
16int 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.