Report abuse


			
    public void run() {
        runtime.getThreadService().registerNewThread(rubyThread);
        ThreadContext context = runtime.getCurrentContext();
        
        context.preRunThread(currentFrame);
        
        // Call the thread's code
        try {
            rubyThread.notifyStarted();
            
            IRubyObject result = proc.call(arguments);
            rubyThread.cleanTerminate(result);
        } catch (ThreadKill tk) {
            // notify any killer waiting on our thread that we're going bye-bye
            synchronized (rubyThread.killLock) {
                rubyThread.killLock.notifyAll();
            }
        } catch (RaiseException e) {
            rubyThread.exceptionRaised(e);
        } catch (JumpException je) {
            je.printStackTrace();
        } finally {
            runtime.getThreadService().setCritical(false);
            runtime.getThreadService().unregisterThread(rubyThread);
            ((RubyThreadGroup)rubyThread.group()).remove(rubyThread);
        }
    }