6 #ifndef SAFE_CIRCULAR_CHAR_BUFFER_HPP 7 #define SAFE_CIRCULAR_CHAR_BUFFER_HPP 8 #include <core/parallel/pthread_tools.hpp> 9 #include <core/logging/assertions.hpp> 35 inline bool is_done()
const {
39 inline bool reader_is_blocked()
const {
45 std::streamsize
size()
const;
65 std::streamsize
write(
const char* c, std::streamsize clen);
73 std::streamsize
write_unsafe(
const char* c, std::streamsize clen);
96 std::streamsize clen);
99 void advance_head(
const std::streamsize advance_len);
124 std::streamsize bufsize;
129 std::streamsize head;
135 std::streamsize tail;
141 volatile bool iswaiting;
std::streamsize introspective_read(char *&s, std::streamsize clen)
std::streamsize write_unsafe(const char *c, std::streamsize clen)
std::streamsize size() const
void end_critical_section_with_signal()
std::streamsize write(const char *c, std::streamsize clen)
void end_critical_section()
void lock() const
Acquires a lock on the mutex.
std::streamsize free_space() const
void unlock() const
Releases a lock on the mutex.
std::streamsize blocking_introspective_read(char *&s, std::streamsize clen)
std::streamsize reserved_size() const
void begin_critical_section()
void signal() const
Signals one waiting thread to wake up.