Changes in src/tests/boundedBuffer.c [6c7b1e7:9f865d1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/boundedBuffer.c
r6c7b1e7 r9f865d1 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 23:02:46201711 // Update Count : 910 // Last Modified On : Mon Oct 30 18:00:10 2017 11 // Update Count : 7 12 12 // 13 13 14 14 #include <stdlib> 15 #include <fstream> // random15 #include <fstream> 16 16 #include <kernel> 17 17 #include <thread> 18 #include <unistd.h> 18 #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 om( 5 ) );54 yield( rand48( 5 ) ); 55 55 insert( prod.buffer, 1 ); 56 56 } // for … … 69 69 cons.sum = 0; 70 70 for ( ;; ) { 71 yield( rand om( 5 ) );71 yield( rand48( 5 ) ); 72 72 int item = remove( cons.buffer ); 73 73 if ( item == -1 ) break; // sentinel ? … … 90 90 processor p; 91 91 92 //rand om_seed( getpid() );93 rand om_seed( 1003 );92 //rand48seed( getpid() ); 93 rand48seed( 1003 ); 94 94 95 95 for ( i = 0; i < Cons; i += 1 ) { // create consumers
Note: See TracChangeset
for help on using the changeset viewer.