예제 #1
0
status_t
RingBuffer::CreateBuffer()
{
	if (fBuffer != NULL)
		return B_OK;

	fBuffer = create_ring_buffer(PIPEFS_MAX_BUFFER_SIZE);
	return fBuffer != NULL ? B_OK : B_NO_MEMORY;
}
예제 #2
0
파일: fifo.cpp 프로젝트: mylegacy/haiku
status_t
RingBuffer::CreateBuffer()
{
	if (fBuffer != NULL)
		return B_OK;

	fBuffer = create_ring_buffer(VFS_FIFO_BUFFER_CAPACITY);
	return fBuffer != NULL ? B_OK : B_NO_MEMORY;
}
예제 #3
0
RingBuffer::RingBuffer(size_t size)
{
	fBuffer = create_ring_buffer(size);
	fLock = create_sem(1, "ring buffer lock");
}