A coexpression type for cooperative multitasking or complex program flow control.
Whenever a coexpression switches control to a paused coexpression, it passes a transfer value to the activated expression. The method/function which paused the coexpression will return the transfer value when the coexpression is reactivated.
Coexpressions are protected by mutexes; attempting to activate a running coexpression from a second thread will cause the second thread to block until the coexpression is paused in the first thread.
Returns the coexpression that activated the current coexpression. If the current coexpression is the initial coexpression in a thread, then returns Self().
Transfers control to coexpr with value as the transfer value. When control passes back to this coexpression, returns the transfer from the activating coexpression.
Yield(value)
Transfers control to the coexpression that activated this one, with value as the transfer value. When control passes back to this coexpression, returns the transfer from the activating coexpression.
Transfers control to coexpr with NIL as the transfer value. When control passes back to this coexpression, returns the transfer from the activating coexpression.
Transfers control to coexpr with value as the transfer value. When control passes back to this coexpression, returns the transfer from the activating coexpression.
Whenever a coexpression switches control to a paused coexpression, it passes a transfer value to the activated expression. The method/function which paused the coexpression will return the transfer value when the coexpression is reactivated.
Coexpressions are protected by mutexes; attempting to activate a running coexpression from a second thread will cause the second thread to block until the coexpression is paused in the first thread.