aboutsummaryrefslogtreecommitdiffstats
path: root/src/MusicBuffer.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-26 22:41:07 +0200
committerMax Kellermann <max@duempel.org>2013-09-26 22:41:07 +0200
commit7fa3b7a267e2e42c06a8350a807b2445b9588372 (patch)
tree30eafd2bd72f65c1f28b5b88e11182c741d93443 /src/MusicBuffer.hxx
parentf3fc76e3c821ae9a55ad9f5d1e71370b37431909 (diff)
downloadmpd-7fa3b7a267e2e42c06a8350a807b2445b9588372.tar.gz
mpd-7fa3b7a267e2e42c06a8350a807b2445b9588372.tar.xz
mpd-7fa3b7a267e2e42c06a8350a807b2445b9588372.zip
PlayerThread: simplify "buffer empty" assertion
Diffstat (limited to 'src/MusicBuffer.hxx')
-rw-r--r--src/MusicBuffer.hxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/MusicBuffer.hxx b/src/MusicBuffer.hxx
index fe14fe300..d2b23d43a 100644
--- a/src/MusicBuffer.hxx
+++ b/src/MusicBuffer.hxx
@@ -43,6 +43,17 @@ public:
*/
MusicBuffer(unsigned num_chunks);
+#ifndef NDEBUG
+ /**
+ * Check whether the buffer is empty. This call is not
+ * protected with the mutex, and may only be used while this
+ * object is inaccessible to other threads.
+ */
+ bool IsEmptyUnsafe() const {
+ return buffer.IsEmpty();
+ }
+#endif
+
/**
* Returns the total number of reserved chunks in this buffer. This
* is the same value which was passed to the constructor