- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/channels/barrier.cfa
r50be8af rc26bea2a 8 8 9 9 size_t total_operations = 0; 10 ssize_t Processors = 1, Tasks = 5, BarrierSize = 2; // must be signed 10 int Processors = 1, Tasks = 5, BarrierSize = 2; 11 11 12 12 typedef channel( int ) Channel; … … 65 65 case 3: 66 66 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 67 BarrierSize = ato ( argv[2] );68 if ( Processors < 1 ) fallthru default;67 BarrierSize = atoi( argv[2] ); 68 if ( Processors < 1 ) goto Usage; 69 69 } // if 70 70 case 2: 71 71 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 72 Processors = ato ( argv[1] );73 if ( Processors < 1 ) fallthru default;72 Processors = atoi( argv[1] ); 73 if ( Processors < 1 ) goto Usage; 74 74 } // if 75 75 case 1: // use defaults 76 76 break; 77 77 default: 78 exit | "Usage: " | argv[0] 78 Usage: 79 sout | "Usage: " | argv[0] 79 80 | " [ processors (> 0) | 'd' (default " | Processors 80 81 | ") ] [ BarrierSize (> 0) | 'd' (default " | BarrierSize 81 82 | ") ]" ; 83 exit( EXIT_FAILURE ); 82 84 } // switch 83 85 if ( Tasks < BarrierSize )
Note: See TracChangeset
for help on using the changeset viewer.