16#include "pw_async2/dispatcher.h"
17#include "pw_channel/channel.h"
18#include "pw_multibuf/allocator.h"
19#include "pw_multibuf/multibuf.h"
20#include "pw_multibuf/v1/allocator_async.h"
21#include "pw_status/status.h"
22#include "pw_stream/stream.h"
23#include "pw_sync/interrupt_spin_lock.h"
24#include "pw_sync/thread_notification.h"
25#include "pw_thread/thread.h"
27namespace pw::channel {
60 multibuf::OwnedChunk WaitForBufferToFillAndTakeFrontChunk();
61 void ProvideFilledBuffer(multibuf::MultiBuf&& filled_buffer);
62 void SetReadError(
Status status);
67 multibuf::MultiBuf buffer_to_fill_
PW_GUARDED_BY(buffer_lock_);
68 multibuf::MultiBuf filled_buffer_
PW_GUARDED_BY(buffer_lock_);
95 multibuf::MultiBuf buffer_to_write_
PW_GUARDED_BY(buffer_lock_);
121 multibuf::MultiBufAllocator& read_allocator,
124 multibuf::MultiBufAllocator& write_allocator);
137 write_thread_options,
165 write_allocation_future_.SetDesiredSize(min_bytes);
166 return write_allocation_future_.Pend(cx);
169 Status DoStageWrite(multibuf::MultiBuf&& data)
override;
Definition: no_destructor.h:77
Definition: channel.h:554
Definition: stream_channel.h:117
State for the stream-reading thread.
Definition: stream_channel.h:31
State for the stream-writing thread.
Definition: stream_channel.h:73
Definition: allocator_async.h:93
Definition: interrupt_spin_lock.h:50
Definition: thread_notification.h:38
constexpr Poll Ready()
Returns a value indicating completion.
Definition: poll.h:337
void ReadLoop(stream::Reader &reader)
void ProvideBufferToFill(multibuf::MultiBuf &&buf)
Provide a buffer for ReadLoop to read data into.
Status SendData(multibuf::MultiBuf &&buf)
void WriteLoop(stream::Writer &writer)
async2::PollResult< multibuf::MultiBuf > PendFilledBuffer(async2::Context &cx)
constexpr Status OkStatus()
Definition: status.h:450
#define PW_GUARDED_BY(x)
Definition: lock_annotations.h:60