Skip to content

Commit

Permalink
Showing 2 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -94,13 +94,11 @@ public void run() {
fiberManager.registerFiber(finalFiber);

try {
try {
final Object arg = finalFiber.waitForResume();
final Object result = finalBlock.rootCall(arg);
finalFiber.lastResumedByFiber.resume(finalFiber, result);
} catch (FiberExitException e) {
// Naturally exit the thread on catching this
}
final Object arg = finalFiber.waitForResume();
final Object result = finalBlock.rootCall(arg);
finalFiber.lastResumedByFiber.resume(finalFiber, result);
} catch (FiberExitException e) {
// Naturally exit the thread on catching this
} finally {
fiberManager.unregisterFiber(finalFiber);
}
@@ -119,6 +117,7 @@ public Object waitForResume() {
FiberMessage message = getContext().getThreadManager().runUntilResult(new BlockingActionWithoutGlobalLock<FiberMessage>() {
@Override
public FiberMessage block() throws InterruptedException {
// TODO (CS 30-Jan-15) this timeout isn't ideal - we already handle interrupts for safepoints
return messageQueue.poll(1, TimeUnit.SECONDS);
}
});
Original file line number Diff line number Diff line change
@@ -28,17 +28,6 @@
*/
public class RubyThread extends RubyBasicObject {

public Object getValue() {
return value;
}

public RubyException getException() {
return exception;
}

public void shutdown() {
}

private final ThreadManager manager;

private final CountDownLatch finished = new CountDownLatch(1);
@@ -143,6 +132,17 @@ public RubyBasicObject getThreadLocals() {
return threadLocals;
}

public Object getValue() {
return value;
}

public RubyException getException() {
return exception;
}

public void shutdown() {
}

public static class ThreadAllocator implements Allocator {

@Override

0 comments on commit 0b8305a

Please sign in to comment.