Examples of checkClosed()


Examples of org.jruby.util.io.OpenFile.checkClosed()

            }
           
            // TODO: Ruby locks the string here
           
            waitReadable(myOpenFile.getMainStreamSafe());
            myOpenFile.checkClosed(getRuntime());

            // We don't check RubyString modification since JRuby doesn't have
            // GIL. Other threads are free to change anytime.

            int bytesRead = myOpenFile.getMainStreamSafe().getDescriptor().read(len, str.getByteList());
View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkClosed()

             * the IO after we return from rb_thread_wait_fd() but before
             * we call read()
             */
            context.getThread().select(fptr.channel(), fptr, SelectionKey.OP_READ);

            fptr.checkClosed();

            str = EncodingUtils.setStrBuf(runtime, str, ilen);
            ByteList strByteList = ((RubyString) str).getByteList();
            n = OpenFile.readInternal(context, fptr, fptr.fd(), strByteList.unsafeBytes(), strByteList.begin(), ilen);

View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkClosed()

        OpenFile fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            int realFileno;
            fptr.checkClosed();
            if (runtime.getPosix().isNative() && (realFileno = fptr.fd().realFileno) != -1) {
                return RubyFileStat.newFileStat(runtime, realFileno);
            } else {
                // no real fd, stat the path
                return context.runtime.newFileStat(fptr.getPath(), false);
View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkClosed()

                    try {
                        context.getThread().sleep(100);
                    } catch (InterruptedException ie) {
                        context.pollThreadEvents();
                    }
                    fptr.checkClosed();
                    continue;

                case EINTR:
                    break;
View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkClosed()

        }

        Ruby runtime = context.runtime;
        try {
            OpenFile openFile = ((RubyIO) src).getOpenFile();
            openFile.checkClosed();
            openFile.checkReadable(context);


            ByteBuffer buffer = ((AbstractMemory) dst).getMemoryIO().asByteBuffer();
            int count = RubyNumeric.num2int(rbLength);
View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkClosed()

        if (fptr.readPending() != 0) return runtime.getTrue();
        // TODO: better effort to get available bytes from our channel
//        if (!FIONREAD_POSSIBLE_P(fptr->fd)) return Qfalse;
        // TODO: actually use timeout
        i = fptr.waitReadable(context, tv);
        fptr.checkClosed();
//        if (ioctl(fptr->fd, FIONREAD, &n)) rb_sys_fail(0);
//        if (n > 0) return io;
        if (i) return io;
        return context.nil;
    }
View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkClosed()

        else {
            tv = timeout.convertToInteger().getLongValue() * 1000;
        }

        i = fptr.waitWritable(context, tv);
        fptr.checkClosed();
        if (i)
            return io;
        return context.nil;
    }
}
View Full Code Here

Examples of org.python.core.io.RawIOBase.checkClosed()

    /**
     * Internal fsync implementation.
     */
    private static void fsync(PyObject fd, boolean metadata) {
        RawIOBase rawIO = FileDescriptors.get(fd);
        rawIO.checkClosed();
        Channel channel = rawIO.getChannel();
        if (!(channel instanceof FileChannel)) {
            throw Py.OSError(Errno.EINVAL);
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.