NO-OP: clang-format
This commit is contained in:
parent
c1d6c0690e
commit
9ce91e2952
@ -20,8 +20,8 @@
|
|||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
|
||||||
CrossThreadChannel::CrossThreadChannel (bool non_blocking)
|
CrossThreadChannel::CrossThreadChannel (bool non_blocking)
|
||||||
: receive_channel (0)
|
: receive_channel (0)
|
||||||
, receive_source (0)
|
, receive_source (0)
|
||||||
{
|
{
|
||||||
fds[0] = -1;
|
fds[0] = -1;
|
||||||
fds[1] = -1;
|
fds[1] = -1;
|
||||||
@ -43,7 +43,7 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
receive_channel = g_io_channel_unix_new (fds[0]);
|
receive_channel = g_io_channel_unix_new (fds[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
CrossThreadChannel::~CrossThreadChannel ()
|
CrossThreadChannel::~CrossThreadChannel ()
|
||||||
@ -57,9 +57,9 @@ CrossThreadChannel::~CrossThreadChannel ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (receive_channel) {
|
if (receive_channel) {
|
||||||
g_io_channel_unref (receive_channel);
|
g_io_channel_unref (receive_channel);
|
||||||
receive_channel = 0;
|
receive_channel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fds[0] >= 0) {
|
if (fds[0] >= 0) {
|
||||||
close (fds[0]);
|
close (fds[0]);
|
||||||
@ -76,7 +76,7 @@ void
|
|||||||
CrossThreadChannel::wakeup ()
|
CrossThreadChannel::wakeup ()
|
||||||
{
|
{
|
||||||
char c = 0;
|
char c = 0;
|
||||||
(void) ::write (fds[1], &c, 1);
|
(void)::write (fds[1], &c, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -89,16 +89,16 @@ CrossThreadChannel::drain ()
|
|||||||
int
|
int
|
||||||
CrossThreadChannel::deliver (char msg)
|
CrossThreadChannel::deliver (char msg)
|
||||||
{
|
{
|
||||||
return ::write (fds[1], &msg, 1);
|
return ::write (fds[1], &msg, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CrossThreadChannel::poll_for_request()
|
CrossThreadChannel::poll_for_request ()
|
||||||
{
|
{
|
||||||
struct pollfd pfd;
|
struct pollfd pfd;
|
||||||
pfd.fd = fds[0];
|
pfd.fd = fds[0];
|
||||||
pfd.events = POLLIN|POLLERR|POLLHUP|POLLNVAL;
|
pfd.events = POLLIN | POLLERR | POLLHUP | POLLNVAL;
|
||||||
while(true) {
|
while (true) {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
/* on macOS poll() will not return when the pipe
|
/* on macOS poll() will not return when the pipe
|
||||||
* is closed in an EOF state. ork around with a timeout.
|
* is closed in an EOF state. ork around with a timeout.
|
||||||
@ -134,5 +134,5 @@ CrossThreadChannel::receive (char& msg, bool wait)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ::read (fds[0], &msg, 1);
|
return ::read (fds[0], &msg, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user