-
-
Save rightfold/c8b297ed603ad17b4eb2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case Opcode::Send: { | |
++instructionPointer(); | |
auto channel = pop(); | |
auto value = pop(); | |
dynamic_cast<Channel&>(*channel).send([=] { | |
scheduledFibers.push(&fiber); | |
return value; | |
}); | |
return; | |
} | |
case Opcode::Receive: { | |
++instructionPointer(); | |
auto channel = pop(); | |
dynamic_cast<Channel&>(*channel).receive([=] (GCPtr<> object) { | |
fiber.evaluationStack.push_back(std::move(object)); | |
scheduledFibers.push(&fiber); | |
}); | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment