Logo Search packages:      
Sourcecode: rjava version File versions  Download package

synchronized REXP org::rosuda::JRI::Rengine::idleEval ( String  s,
boolean  convert 
) [inline]

This method is very much like eval(String,boolean), except that it is non-blocking and returns null if the engine is busy.

Since:
JRI 0.3
Parameters:
s string to evaluate
convert flag denoting whether an empty or fully-converted REXP should be returned (see eval(String,boolean) for details)
Returns:
result of the evaluation or null if the engine is busy

Definition at line 568 of file Rengine.java.

References rniEval(), rniParse(), Rsync, org::rosuda::JRI::Mutex::tryLock(), and org::rosuda::JRI::Mutex::unlock().

                                                                 {
        int lockStatus=Rsync.tryLock();
        if (lockStatus==1) return null; // 1=locked by someone else
        boolean obtainedLock=(lockStatus==0);
        try {
            long pr=rniParse(s, 1);
            if (pr>0) {
                long er=rniEval(pr, 0);
                if (er>0) {
                    REXP x=new REXP(this, er, convert);
                    return x;
                }
            }
        } finally {
            if (obtainedLock) Rsync.unlock();
        }
        return null;
    }


Generated by  Doxygen 1.6.0   Back to index