- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/channels/daisy_chain.cfa
r50be8af rcb344f7 8 8 9 9 size_t total_operations = 0; 10 s size_t Processors = 1, Tasks = 4; // must be signed10 size_t Processors = 1, Tasks = 4; 11 11 12 12 owner_lock o; … … 37 37 case 3: 38 38 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 39 Tasks = ato ( argv[2] );40 if ( Tasks < 1 ) fallthru default;39 Tasks = atoi( argv[2] ); 40 if ( Tasks < 1 ) goto Usage; 41 41 } // if 42 42 case 2: 43 43 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 44 Processors = ato ( argv[1] );45 if ( Processors < 1 ) fallthru default;44 Processors = atoi( argv[1] ); 45 if ( Processors < 1 ) goto Usage; 46 46 } // if 47 47 case 1: // use defaults 48 48 break; 49 49 default: 50 exit | "Usage: " | argv[0] 50 Usage: 51 sout | "Usage: " | argv[0] 51 52 | " [ processors (> 0) | 'd' (default " | Processors 52 53 | ") ] [ channel size (>= 0) | 'd' (default " | Tasks 53 54 | ") ]" ; 55 exit( EXIT_FAILURE ); 54 56 } // switch 55 57 processor proc[Processors - 1]; … … 69 71 // sout | total_operations; 70 72 sout | "done"; 73 74 return 0; 71 75 }
Note: See TracChangeset
for help on using the changeset viewer.