Logtalk reference manual
Built-in predicate: threaded_exit/1

threaded_exit/1

Description

threaded_exit(Goal)

Retrieve the result of proving Goal in a new thread. This predicate blocks execution until the reply is sent to the this message queue by the thread executing the goal. When there is no thread proving the goal, the predicate generates an exception. This predicate is non-deterministic, providing access to any alternative solutions of its argument.

Template and modes

threaded_exit(+callable)

Errors

Goal is a variable:
instantiation_error
Goal is neither a variable nor a callable term:
type_error(callable, Goal)
no thread is running for proving Goal:
existence_error(goal_thread, Goal)

Examples

To retrieve an asynchronous goal proof result:
threaded_exit(Goal)
To retrieve an asynchronous message to self result:
threaded_exit(::Goal)
To retrieve an asynchronous message result:
threaded_exit(Object::Goal)