/usr/lib/swipl/library/thread.pl
All Application Manual Name SummaryHelp

  • swipl
    • library
      • error.pl
      • debug.pl -- Print debug messages and test assertions
      • apply.pl
      • lists.pl
      • broadcast.pl
      • shlib.pl -- Utility library for loading foreign objects (DLLs, shared objects)
      • option.pl
      • thread_pool.pl
      • gensym.pl
      • settings.pl
      • arithmetic.pl
      • main.pl
      • readutil.pl
      • operators.pl
      • pairs.pl -- Operations on key-value lists
      • prolog_source.pl
      • record.pl
      • quasi_quotations.pl -- Define Quasi Quotation syntax
      • sandbox.pl
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • yall.pl
      • assoc.pl -- Binary associations
      • prolog_format.pl
      • pure_input.pl
      • solution_sequences.pl
      • ordsets.pl
      • random.pl
      • base64.pl -- Base64 encoding and decoding
      • aggregate.pl
      • predicate_options.pl
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • pprint.pl
      • atom.pl
      • modules.pl
      • occurs.pl
      • prolog_xref.pl
      • prolog_colour.pl
      • lazy_lists.pl
      • ugraphs.pl
      • url.pl
      • www_browser.pl
      • prolog_pack.pl -- A package manager for Prolog
      • git.pl
      • utf8.pl
      • quintus.pl
      • prolog_versions.pl
      • prolog_wrap.pl
      • dialect.pl
      • date.pl
      • persistency.pl
      • iostream.pl -- Utilities to deal with streams
      • prolog_code.pl
      • strings.pl
      • dif.pl
      • edinburgh.pl
      • terms.pl
      • ansi_term.pl
      • threadutil.pl -- Interactive thread utilities
      • prolog_stack.pl
      • prolog_clause.pl
      • prolog_breakpoints.pl -- Manage Prolog break-points
      • wfs.pl
      • sort.pl
      • dicts.pl
      • varnumbers.pl
      • rbtrees.pl -- Red black trees
      • backcomp.pl -- Backward compatibility
      • charsio.pl -- I/O on Lists of Character Codes
      • hashtable.pl
      • base32.pl -- Base32 encoding and decoding
      • codesio.pl
      • coinduction.pl
      • heaps.pl
      • statistics.pl
      • when.pl
      • ctypes.pl -- Character code classification
      • prolog_trace.pl
      • macros.pl
      • tables.pl
      • listing.pl -- List programs and pretty print clauses
      • qpforeign.pl
      • check_installation.pl -- Check installation issues and features
      • system.pl
      • qsave.pl
      • zip.pl
      • increval.pl
      • edit.pl
      • prolog_coverage.pl
      • check.pl -- Consistency checking
      • pio.pl
      • prolog_codewalk.pl -- Prolog code walker
      • optparse.pl -- command line parsing
      • prolog_profile.pl
      • oset.pl
      • help.pl
      • prolog_debug.pl
      • shell.pl
      • nb_set.pl
      • streams.pl -- Manage Prolog streams
      • intercept.pl
      • exceptions.pl
      • thread.pl -- High level thread primitives
        • concurrent/3
        • concurrent_forall/2
        • concurrent_forall/3
        • concurrent_and/2
        • concurrent_and/3
        • concurrent_maplist/2
        • concurrent_maplist/3
        • concurrent_maplist/4
        • first_solution/3
        • call_in_thread/2
        • call_in_thread/3
      • writef.pl
 call_in_thread(+Thread, :Goal) is semidet
 call_in_thread(+Thread, :Goal, +Options) is semidet
Run Goal as an interrupt in the context of Thread. This is based on thread_signal/2. If waiting times out, we inject a stop(Reason) exception into Goal. Interrupts can be nested, i.e., it is allowed to run a call_in_thread/2 while the target thread is processing such an interrupt.

Options are passed to thread_get_message/3 and notably allow for specifying a timeout. If a timeout is reached, this predicate will attempt to kill Goal in Thread and act according to the option on_timeout.

on_timeout(:Goal)
If waiting terminates due to a timeout(Time), or deadline(Stamp) option, call Goal. The default is throw(time_limit_exceeded).

This predicate is primarily intended for debugging and inspection tasks.