OSDN Git Service

fifo: add shutdown state
authorGlenn Kasten <gkasten@google.com>
Tue, 22 Nov 2016 22:00:23 +0000 (14:00 -0800)
committerGlenn Kasten <gkasten@google.com>
Wed, 30 Nov 2016 00:15:47 +0000 (16:15 -0800)
commit0b2947b464581b0f6e7426c6a2894494fafba324
treefb2efd62198f0604fb96335f30648379255402d4
parent34ad30eb0b4d1625754d131eb2d772d1fa863535
fifo: add shutdown state

FIFO is marked shutdown after an "impossible" error is detected.
Usually this indicate that memory has become corrupted, or incorrect use
of the API.  Once the FIFO is marked shutdown, all APIs that can return
an error code will return -EIO, and all other APIs will become no-ops.

Test: see unit tests in tests/ directory
Change-Id: I559145d613c3783a699a9ced062dd5ff3676769d
audio_utils/fifo.cpp
audio_utils/include/audio_utils/fifo.h