Changeset 28e58fd for src/tests/sched-int-wait.c
- Timestamp:
- Aug 25, 2017, 10:38:34 AM (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:
- 800d275
- Parents:
- af08051 (diff), 3eab308c (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/sched-int-wait.c
raf08051 r28e58fd 33 33 //---------------------------------------------------------------------------------------------------- 34 34 // Tools 35 void signal( condition * cond, global_t * mutex a, global_t *mutex b ) {35 void signal( condition * cond, global_t & mutex a, global_t & mutex b ) { 36 36 signal( cond ); 37 37 } 38 38 39 void signal( condition * cond, global_t * mutex a, global_t * mutex b, global_t *mutex c ) {39 void signal( condition * cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) { 40 40 signal( cond ); 41 41 } 42 42 43 void wait( condition * cond, global_t * mutex a, global_t *mutex b ) {43 void wait( condition * cond, global_t & mutex a, global_t & mutex b ) { 44 44 wait( cond ); 45 45 } 46 46 47 void wait( condition * cond, global_t * mutex a, global_t * mutex b, global_t *mutex c ) {47 void wait( condition * cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) { 48 48 wait( cond ); 49 49 } … … 51 51 //---------------------------------------------------------------------------------------------------- 52 52 // Signaler 53 void main( Signaler *this ) {53 void main( Signaler & this ) { 54 54 55 55 while( waiter_left != 0 ) { … … 57 57 switch( action ) { 58 58 case 0: 59 signal( &condABC, &globalA, &globalB, &globalC );59 signal( &condABC, globalA, globalB, globalC ); 60 60 break; 61 61 case 1: 62 signal( &condAB , &globalA, &globalB );62 signal( &condAB , globalA, globalB ); 63 63 break; 64 64 case 2: 65 signal( &condBC , &globalB, &globalC );65 signal( &condBC , globalB, globalC ); 66 66 break; 67 67 case 3: 68 signal( &condAC , &globalA, &globalC );68 signal( &condAC , globalA, globalC ); 69 69 break; 70 70 default: … … 78 78 //---------------------------------------------------------------------------------------------------- 79 79 // Waiter ABC 80 void main( WaiterABC *this ) {80 void main( WaiterABC & this ) { 81 81 for( int i = 0; i < N; i++ ) { 82 wait( &condABC, &globalA, &globalB, &globalC );82 wait( &condABC, globalA, globalB, globalC ); 83 83 } 84 84 … … 88 88 //---------------------------------------------------------------------------------------------------- 89 89 // Waiter AB 90 void main( WaiterAB *this ) {90 void main( WaiterAB & this ) { 91 91 for( int i = 0; i < N; i++ ) { 92 wait( &condAB , &globalA, &globalB );92 wait( &condAB , globalA, globalB ); 93 93 } 94 94 … … 98 98 //---------------------------------------------------------------------------------------------------- 99 99 // Waiter AC 100 void main( WaiterAC *this ) {100 void main( WaiterAC & this ) { 101 101 for( int i = 0; i < N; i++ ) { 102 wait( &condAC , &globalA, &globalC );102 wait( &condAC , globalA, globalC ); 103 103 } 104 104 … … 108 108 //---------------------------------------------------------------------------------------------------- 109 109 // Waiter BC 110 void main( WaiterBC *this ) {110 void main( WaiterBC & this ) { 111 111 for( int i = 0; i < N; i++ ) { 112 wait( &condBC , &globalB, &globalC );112 wait( &condBC , globalB, globalC ); 113 113 } 114 114
Note:
See TracChangeset
for help on using the changeset viewer.