diff options
author | Elliott Hughes <enh@google.com> | 2012-09-28 15:53:29 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2012-10-03 17:15:29 -0700 |
commit | b2e6be1cc1d375ca2fc28ee1fdfc10c0adc2554d (patch) | |
tree | 6e906dd3bafe851b3cf050e1744aa771e8ad181b /annotations/generate_annotated_java_files.py | |
parent | 77b2088858b199e60002bfb2acb7a883c6aba82a (diff) |
Rewrite NIO Pipe to use socketpair(2).
Our Pipe originally used socket(2) to create AF_INET/AF_INET6
sockets. This was clearly a bad idea.
I rewrote it to use socketpair(2) and AF_UNIX, but this was
before the big "expose POSIX" rewrite, so it required a bunch
of hacks in the native code, so I went with pipe(2) instead.
The trouble with pipe(2) is that we end up using FileChannel
to implement the Pipe.SinkChannel and Pipe.SourceChannel, but
the kernel won't wake a read(2) on a pipe if another thread
calls close(2) on it, so we started failing interrupt tests.
This (final?) rewrite is hopefully the best of all worlds:
we don't have any INTERNET permission needs, the code is as
simple as the pipe(2) code, and interruption works.
Bug: 7084342
Bug: 2735373
Bug: http://code.google.com/p/android/issues/detail?id=9431
(cherry picked from commit 3218082325b6b8713a8ac15731482e3da86a7df9)
Change-Id: Ib92cdf8c818f6bba1f00e191f1b624ce9e693754
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions