source:
benchmark/io/http/channel.hfa@
3a7aa94
Last change on this file since 3a7aa94 was 0aec496, checked in by , 5 years ago | |
---|---|
|
|
File size: 393 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; | |
14 | condition_variable prods; | |
15 | condition_variable cons; | |
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 ); | |
23 | // } |
Note:
See TracBrowser
for help on using the repository browser.