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