/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class SinkChannelImpl
extends Pipe.SinkChannel
implements SelChImpl
{
// Used to make native read and write calls
// The file descriptor associated with this channel
// even after the value in the file descriptor object has been set to -1
int fdVal;
// ID of native thread doing write, for signalling
// Lock held by current reading thread
// Lock held by any thread that modifies the state fields declared below
// DO NOT invoke a blocking I/O operation while holding this lock!
// -- The following fields are protected by stateLock
// Channel state
// -- End of fields protected by stateLock
return fd;
}
public int getFDVal() {
return fdVal;
}
super(sp);
}
synchronized (stateLock) {
if (th != 0)
if (!isRegistered())
kill();
}
}
synchronized (stateLock) {
return;
if (state == ST_UNINITIALIZED) {
return;
}
assert !isOpen() && !isRegistered();
}
}
}
int newOps = initialOps;
throw new Error("POLLNVAL detected");
}
}
}
}
}
if (!isOpen())
throw new ClosedChannelException();
}
ensureOpen();
synchronized (lock) {
int n = 0;
try {
begin();
if (!isOpen())
return 0;
do {
} finally {
thread = 0;
}
}
}
throw new NullPointerException();
ensureOpen();
synchronized (lock) {
long n = 0;
try {
begin();
if (!isOpen())
return 0;
do {
} finally {
thread = 0;
}
}
}
throws IOException
{
throw new IndexOutOfBoundsException();
}
static {
nd = new FileDispatcherImpl();
}
}