aboutsummaryrefslogtreecommitdiffstats
path: root/src/ringbuf.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ringbuf: create a new struct rbvec instead of reusing struct iovecEric Wong2008-08-301-6/+12
| | | | | | | Using struct iovec means having to cast iov_base everywhere we want to do pointer arithmetic. Instead, just use rbvec which can be safely casted to iovec whenever we use the readv/writev functions.
* fixed ringbuf.c warningsMax Kellermann2008-08-301-1/+1
| | | | | Fix a "signed/unsigned comparison warning", and several void pointer math warnings.
* core rewrite (decode,player,outputBuffer,playlist)Eric Wong2008-08-161-2/+4
| | | | | | | | | | | | | This is a huge refactoring of the core mpd process. The queueing/buffering mechanism is heavily reworked. The player.c code has been merged into outputBuffer (the actual ring buffering logic is handled by ringbuf.c); and decode.c actually handles decoding stuff. The end result is several hundreds of lines shorter, even though we still have a lot of DEBUG statements left in there for tracing and a lot of assertions, too.
* ringbuf: add thread-safe, thread-specific reset functionsEric Wong2008-06-301-0/+18
| | | | | | This will allow both the reader and writer threads to reset the ringbuffer in a thread-safe fashion. git-svn-id: https://svn.musicpd.org/mpd/trunk@7390 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* ringbuf: get_{write,read}_vector returns total bytes in both vec eltsEric Wong2008-06-301-2/+5
| | | | | This will eliminate unnecessary calls to ringbuf_{read,write}_space git-svn-id: https://svn.musicpd.org/mpd/trunk@7389 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add a generic ring buffer implementationEric Wong2008-06-301-0/+205
This piece of code is from the JACK Audio Connection Kit (trimmed down a bit for better readability). The vector functions now reuse the common iovec struct used by writev/readv instead of reinventing an identical but differently-named struct. From the comments: > ISO/POSIX C version of Paul Davis's lock free ringbuffer C++ code. > This is safe for the case of one read thread and one write thread. License is LGPL 2.1 or later git-svn-id: https://svn.musicpd.org/mpd/trunk@7386 09075e82-0dd4-0310-85a5-a0d7c8717e4f