64 size_t write(
const T* buffer,
size_t count,
bool block =
true);
71 size_t writeAvailable(
const T* buffer,
size_t count,
bool atomic =
false);
78 size_t writeAtomic(
const T* buffer,
size_t count,
bool block =
true);
85 bool tryWrite(
const T* buffer,
size_t count);
91 size_t read(T* buffer,
size_t count,
bool block =
true);
122 size_t getDataSize();
133 bool canWrite(
bool block);
138 bool canRead(
bool block);
141 uint64_t readableGeneration()
const;
142 uint64_t writableGeneration()
const;
164 void cullMonitorTargets(
Thread* pThread);
169 void cullMonitorTargets(
Semaphore* pSemaphore);
174 void cullMonitorTargets(
Event* pEvent);
176#if HOSTED && PEDIGREE_HOSTED_SMOKE_TESTS
178 void acquireHostedOperationLock();
179 void releaseHostedOperationLock();
180 size_t getHostedActiveOperationCount();
184 WITHOUT_IMPLICIT_CONSTRUCTORS(
Buffer);
189 : m_TerminationDeferral(), m_Buffer(buffer.beginOperation() ? &buffer :
nullptr) {}
193 m_Buffer->endOperation();
197 explicit operator bool()
const {
198 return m_Buffer !=
nullptr;
209 bool beginOperation();
217 void notifyMonitors();
220 void notifyMonitorsLocked();
223 size_t writeLocked(
const T* buffer,
size_t count);
228 void addSegment(
const T* buffer,
size_t count);
233 static const size_t m_SegmentSize = 32768;
243 T data[m_SegmentSize];
269 size_t m_ActiveOperations;