source:
benchmark/io/http/channel.hfa@
1911f37
| Last change on this file since 1911f37 was db09685, checked in by , 4 months ago | |
|---|---|
|
|
| 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.