- Timestamp:
- Mar 23, 2017, 3:05:36 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ae6f1ec
- Parents:
- bcda04c
- Location:
- src/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/monitor.c
rbcda04c rbd4d011 26 26 } 27 27 28 struct MyThread { thread_desc __thrd; }; 29 30 DECL_THREAD(MyThread); 31 32 void ?{}( MyThread * this ) {} 33 void ^?{}( MyThread * mutex this ) {} 28 thread MyThread {}; 34 29 35 30 void main( MyThread* this ) { … … 43 38 processor p; 44 39 { 45 scoped(MyThread)f[4];40 MyThread f[4]; 46 41 } 47 42 sout | global.value | endl; -
src/tests/thread.c
rbcda04c rbd4d011 4 4 #include <thread> 5 5 6 struct First { thread_desc __thrd; signal_once* lock; };7 struct Second { thread_desc __thrd; signal_once* lock; };6 // thread First; 7 // void main(First* this); 8 8 9 DECL_THREAD(First); 10 DECL_THREAD(Second); 9 // thread Second; 10 // void main(Second* this); 11 12 thread First { signal_once* lock; }; 13 thread Second { signal_once* lock; }; 11 14 12 15 void ?{}( First * this, signal_once* lock ) { this->lock = lock; } 13 16 void ?{}( Second * this, signal_once* lock ) { this->lock = lock; } 14 15 void ^?{}( First * mutex this ) {}16 void ^?{}( Second * mutex this ) {}17 17 18 18 void main(First* this) { … … 39 39 processor p; 40 40 { 41 scoped(First)f = { &lock };42 scoped(Second)s = { &lock };41 First f = { &lock }; 42 Second s = { &lock }; 43 43 } 44 44 }
Note: See TracChangeset
for help on using the changeset viewer.