Changeset ef42b143 for src/tests/multi-monitor.c
- Timestamp:
- Mar 16, 2017, 5:20:16 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:
- 3743983
- Parents:
- 1fbab5a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/multi-monitor.c
r1fbab5a ref42b143 6 6 static int global12, global23, global13; 7 7 8 static monitor_desc m1, m2, m3; 8 struct monitor_t { 9 monitor_desc m; 10 }; 9 11 10 void increment( /*mutex*/ monitor_desc * p1, /*mutex*/ monitor_desc * p2, int * value ) { 11 monitor_desc * mons[] = { p1, p2 }; 12 monitor_guard_t g = { mons, 2 }; 12 monitor_desc * get_monitor( monitor_t * this ) { 13 return &this->m; 14 } 15 16 static monitor_t m1, m2, m3; 17 18 void increment( monitor_t * mutex p1, monitor_t * mutex p2, int * value ) { 13 19 *value += 1; 14 20 }
Note: See TracChangeset
for help on using the changeset viewer.