Logtalk reference manual
Built-in predicate: threaded_exit/2

threaded_exit/2

Description

threaded_exit(Goal, Options)

Retrieve the result of proving Goal in a new thread. By default, this call blocks execution until the reply is sent to the this thread by the thread executing the goal. This predicate is non-deterministic, providing access to the alternative solutions of its first argument. The option peek may be used to check if the reply is already available on the this thread. The option discard may be used to discard all matching replies.

Template and modes

threaded_exit(+callable, +list)

Examples

To retrieve the goal proof result:
threaded_exit(Goal, List)
To retrieve the message result:
threaded_exit(::Goal, List)
To retrieve the message result:
threaded_exit(Object::Goal, List)