Changeset 168c007 for src/tests/monitor.c
- Timestamp:
- Mar 21, 2017, 12:50:27 PM (7 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:
- da6d4566, f5392c1
- Parents:
- 94a8123 (diff), e04b636 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/monitor.c
r94a8123 r168c007 13 13 } 14 14 15 monitor_desc * get_monitor( global_t * this ) { 16 return &this->m; 17 } 18 15 19 static global_t global; 16 20 17 void increment( /*mutex*/ global_t * this ) { 18 monitor_desc * mon = &this->m; 19 monitor_guard_t g1 = { &mon }; 20 { 21 monitor_guard_t g2 = { &mon }; 22 { 23 monitor_guard_t g3 = { &mon }; 24 this->value += 1; 25 } 26 } 21 void increment3( global_t * mutex this ) { 22 this->value += 1; 27 23 } 28 24 29 struct MyThread { thread_desc t; }; 25 void increment2( global_t * mutex this ) { 26 increment3( this ); 27 } 28 29 void increment( global_t * mutex this ) { 30 increment2( this ); 31 } 32 33 struct MyThread { thread_desc __thrd; }; 30 34 31 35 DECL_THREAD(MyThread);
Note: See TracChangeset
for help on using the changeset viewer.