Package org.jruby

Examples of org.jruby.RubyThread.sleep()


            // If all streams are nil, just sleep the specified time (JRUBY-4699)
            if (args[0].isNil() && args[1].isNil() && args[2].isNil()) {
                if (timeout > 0) {
                    RubyThread thread = context.getThread();
                    long now = System.currentTimeMillis();
                    thread.sleep(timeout);
                    // Guard against spurious wakeup
                    while (System.currentTimeMillis() < now + timeout) {
                        thread.sleep(1);
                    }
View Full Code Here


                    RubyThread thread = context.getThread();
                    long now = System.currentTimeMillis();
                    thread.sleep(timeout);
                    // Guard against spurious wakeup
                    while (System.currentTimeMillis() < now + timeout) {
                        thread.sleep(1);
                    }

                }
            } else {
                doSelect(runtime, has_timeout, timeout);
View Full Code Here

            if (args[0].isNil() && args[1].isNil() && args[2].isNil()) {
                RubyThread thread = context.getThread();
                if (has_timeout) {
                    if (timeout > 0) {
                        long now = System.currentTimeMillis();
                        thread.sleep(timeout);
                        // Guard against spurious wakeup
                        while (System.currentTimeMillis() < now + timeout) {
                            thread.sleep(1);
                        }
                    }
View Full Code Here

                    if (timeout > 0) {
                        long now = System.currentTimeMillis();
                        thread.sleep(timeout);
                        // Guard against spurious wakeup
                        while (System.currentTimeMillis() < now + timeout) {
                            thread.sleep(1);
                        }
                    }
                } else {
                    thread.sleep(0);
                }
View Full Code Here

                        while (System.currentTimeMillis() < now + timeout) {
                            thread.sleep(1);
                        }
                    }
                } else {
                    thread.sleep(0);
                }
            } else {
                doSelect(runtime, has_timeout, timeout);
                processSelectedKeys(runtime);
                processPendingAndUnselectable();
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.