Changes in src/tests/boundedBuffer.c [9f865d1:6c7b1e7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/boundedBuffer.c
r9f865d1 r6c7b1e7 8 8 // Created On : Mon Oct 30 12:45:13 2017 9 9 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Mon Oct 30 18:00:10201711 // Update Count : 710 // Last Modified On : Mon Oct 30 23:02:46 2017 11 // Update Count : 9 12 12 // 13 13 14 14 #include <stdlib> 15 #include <fstream> 15 #include <fstream> // random 16 16 #include <kernel> 17 17 #include <thread> 18 #include <unistd.h> // getpid18 #include <unistd.h> // getpid 19 19 20 20 monitor Buffer { … … 52 52 void main( Producer & prod ) { 53 53 for ( int i = 1; i <= prod.N; i += 1 ) { 54 yield( rand 48( 5 ) );54 yield( random( 5 ) ); 55 55 insert( prod.buffer, 1 ); 56 56 } // for … … 69 69 cons.sum = 0; 70 70 for ( ;; ) { 71 yield( rand 48( 5 ) );71 yield( random( 5 ) ); 72 72 int item = remove( cons.buffer ); 73 73 if ( item == -1 ) break; // sentinel ? … … 90 90 processor p; 91 91 92 //rand 48seed( getpid() );93 rand 48seed( 1003 );92 //random_seed( getpid() ); 93 random_seed( 1003 ); 94 94 95 95 for ( i = 0; i < Cons; i += 1 ) { // create consumers
Note: See TracChangeset
for help on using the changeset viewer.