Table of Contents

Interface IExecutionGate

Namespace
RDCore.SDK.Runtime.Abstract.Execution
Assembly
RDCore.SDK.dll

Where a program waits when it is stopped, if it is to be resumed.

public interface IExecutionGate

Remarks

A program cannot be resumed from what it leaves behind when it is unwound. A Stop in a function that is called in the middle of an expression has half of the statement that called it evaluated, and the interpreter has nothing that holds half a statement: the state of the program is its call stack and the program counter of each activation, and the rest is on the stack of whoever is evaluating. So a program that is to be resumed does not leave: it waits where it is, and the thread it runs on is held by Suspend(RuntimeHaltKind, SourceLocation?) until the answer comes.

Whoever runs the program on a thread of its own installs a gate in Gate; nothing else needs to know that there is one. A program that is run without one is stopped by a Stop the way it always was.

⚖️RDCore provides an implementation of this interface licensed under GPLv3.

Methods

Suspend(RuntimeHaltKind, SourceLocation?)

Holds the calling thread, which is the program's, until it is told what to do.

SuspensionDecision Suspend(RuntimeHaltKind kind, SourceLocation? location)

Parameters

kind RuntimeHaltKind

Why the program is stopped.

location SourceLocation?

The statement that stopped it, or null when it was not one.

Returns

SuspensionDecision

What to do with the program.