Skip to content

Commit

Permalink
[Truffle] Fix spec failure.
Browse files Browse the repository at this point in the history
* Fiber also receive ThreadExitException with the current scheme.
  • Loading branch information
eregon committed Apr 21, 2015
1 parent 6d7368c commit 76990cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -10,14 +10,15 @@
package org.jruby.truffle.runtime.core;

import com.oracle.truffle.api.nodes.ControlFlowException;

import com.oracle.truffle.api.nodes.Node;

import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.objects.Allocator;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.control.BreakException;
import org.jruby.truffle.runtime.control.RaiseException;
import org.jruby.truffle.runtime.control.ReturnException;
import org.jruby.truffle.runtime.control.ThreadExitException;
import org.jruby.truffle.runtime.subsystems.FiberManager;
import org.jruby.truffle.runtime.subsystems.ThreadManager;
import org.jruby.truffle.runtime.subsystems.ThreadManager.BlockingActionWithoutGlobalLock;
Expand Down Expand Up @@ -123,7 +124,7 @@ public void run() {
final Object[] args = finalFiber.waitForResume();
final Object result = finalBlock.rootCall(args);
finalFiber.resume(finalFiber.lastResumedByFiber, true, result);
} catch (FiberExitException e) {
} catch (FiberExitException | ThreadExitException e) { // TODO (eregon, 21 Apr. 2015): The thread should cleanly kill its fibers when dying.
// Naturally exit the thread on catching this
} catch (ReturnException e) {
sendMessageTo(finalFiber.lastResumedByFiber, new FiberExceptionMessage(finalFiber.getContext().getCoreLibrary().unexpectedReturn(null)));
Expand Down
Expand Up @@ -22,6 +22,7 @@
public class FiberManager {

private final RubyFiber rootFiber;
// FIXME (eregon): per ruby thread
private RubyFiber currentFiber;

private final Set<RubyFiber> runningFibers = Collections.newSetFromMap(new ConcurrentHashMap<RubyFiber, Boolean>());
Expand Down

0 comments on commit 76990cd

Please sign in to comment.