Last change
on this file since 2d743bd was db09685, checked in by Peter A. Buhr <pabuhr@…>, 7 weeks ago |
more change type name condition_variable to cond_lock
|
-
Property mode
set to
100644
|
File size:
376 bytes
|
Rev | Line | |
---|
[0aec496] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | #include <assert.h>
|
---|
| 4 | #include <mutex.hfa>
|
---|
| 5 |
|
---|
| 6 | // forall(otype T) {
|
---|
| 7 | struct channel {
|
---|
| 8 | int * buffer;
|
---|
| 9 | int front;
|
---|
| 10 | int back;
|
---|
| 11 | int count;
|
---|
| 12 | int size;
|
---|
| 13 | mutex_lock lock;
|
---|
[db09685] | 14 | cond_lock prods;
|
---|
| 15 | cond_lock cons;
|
---|
[0aec496] | 16 | };
|
---|
| 17 |
|
---|
| 18 | void ?{}( channel & this, int size );
|
---|
| 19 | void ^?{}( channel & this );
|
---|
| 20 |
|
---|
| 21 | void put( channel & this, int elem );
|
---|
| 22 | int take( channel & this );
|
---|
[db09685] | 23 | // }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.