Changeset 534d84e for src/tests/concurrent/examples/boundedBufferEXT.c
- Timestamp:
- Apr 28, 2018, 10:35:51 AM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- b6dc097
- Parents:
- 9997fee (diff), a0c7d5cc (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/concurrent/examples/boundedBufferEXT.c
r9997fee r534d84e 1 // 1 // 2 2 // The contents of this file are covered under the licence agreement in the 3 3 // file "LICENCE" distributed with Cforall. 4 // 5 // boundedBufferEXT.c -- 6 // 4 // 5 // boundedBufferEXT.c -- 6 // 7 7 // Author : Peter A. Buhr 8 8 // Created On : Wed Apr 18 22:52:12 2018 … … 10 10 // Last Modified On : Fri Apr 20 22:25:14 2018 11 11 // Update Count : 6 12 // 12 // 13 13 14 14 #include <stdlib> // random … … 39 39 forall( otype T ) 40 40 void insert( Buffer(T) & mutex buffer, T elem ) with( buffer ) { 41 if ( count == BufferSize ) waitfor( remove );41 if ( count == BufferSize ) waitfor( remove, buffer ); 42 42 elements[back] = elem; 43 43 back = ( back + 1 ) % BufferSize; … … 47 47 forall( otype T ) 48 48 T remove( Buffer(T) & mutex buffer ) with( buffer ) { 49 if ( count == 0 ) waitfor( insert );49 if ( count == 0 ) waitfor( insert, buffer ); 50 50 T elem = elements[front]; 51 51 front = ( front + 1 ) % BufferSize;
Note: See TracChangeset
for help on using the changeset viewer.