diff options
author | Tiago Vignatti <tiago.vignatti@nokia.com> | 2010-08-06 15:12:43 +0300 |
---|---|---|
committer | Tiago Vignatti <tiago.vignatti@nokia.com> | 2010-08-06 15:17:58 +0300 |
commit | 35c087adae0106086728d7376d13bccea493dca2 (patch) | |
tree | 2281e136fb98e54028af136f5dcc90e7d91b80e7 | |
parent | 17349d8b86b7cfe8a50fc968695df77585a73064 (diff) |
os: inputthread: non-blocking I/O pipe's read end is enough
Although we're not expecting to see the case of the pipe become full, we
prefer to block write if this happens.
Also, document better a bit the reason of read end be non-blocking.
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
-rw-r--r-- | os/connection.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/os/connection.c b/os/connection.c index 8760c1256..9be20779e 100644 --- a/os/connection.c +++ b/os/connection.c @@ -403,13 +403,13 @@ CreateWellKnownSockets(void) exit(1); } - /* Make the pipes nonblocking */ - fcntl(tfd[0], F_SETFL, O_NONBLOCK); - fcntl(tfd[1], F_SETFL, O_NONBLOCK); - InputThreadReadPipe = tfd[0]; InputThreadWritePipe = tfd[1]; + /* We make pipe's read end nonblocking so while main thread is busy doing + * something, the input thread can work in parallel */ + fcntl(InputThreadReadPipe, F_SETFL, O_NONBLOCK); + FD_ZERO(&InputThreadFd); NumDevicesThreaded = 0; |