10 error <<
"cannot create x-thread pipe for read (%2)" << ::strerror (errno) <<
endmsg;
15 if (fcntl (
fds[0], F_SETFL, O_NONBLOCK)) {
16 error <<
"cannot set non-blocking mode for x-thread pipe (read) (" << ::strerror (errno) <<
')' <<
endmsg;
20 if (fcntl (
fds[1], F_SETFL, O_NONBLOCK)) {
21 error <<
"cannot set non-blocking mode for x-thread pipe (write) (%2)" << ::strerror (errno) <<
')' <<
endmsg;
50 (void) ::write (
fds[1], &c, 1);
57 while (::read (
fds[0], buf,
sizeof (buf)) > 0) {};
63 return ::write (
fds[1], &msg, 1);
73 if (poll (pfd, 1, -1) < 0) {
79 if (pfd[0].revents & ~
POLLIN) {
83 if (pfd[0].revents &
POLLIN) {
98 return ::read (
fds[0], &msg, 1);
int receive(char &msg, bool wait=false)
LIBPBD_API Transmitter error
std::ostream & endmsg(std::ostream &ostr)
CrossThreadChannel(bool non_blocking)
GIOChannel * receive_channel