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

  • swipl
    • library
      • error.pl
      • debug.pl
      • apply.pl
      • lists.pl
      • broadcast.pl -- Event service
      • shlib.pl -- Utility library for loading foreign objects (DLLs, shared objects)
      • option.pl
      • thread_pool.pl -- Resource bounded thread management
      • gensym.pl
      • settings.pl -- Setting management
      • arithmetic.pl
      • main.pl -- Provide entry point for scripts
      • readutil.pl
      • operators.pl
      • pairs.pl
      • prolog_source.pl
      • record.pl -- Access compound arguments by name
      • quasi_quotations.pl
      • sandbox.pl -- Sandboxed Prolog code
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • yall.pl
      • assoc.pl
      • prolog_format.pl -- Analyse format specifications
      • pure_input.pl -- Pure Input from files and streams
      • solution_sequences.pl
      • ordsets.pl -- Ordered set manipulation
      • random.pl -- Random numbers
      • base64.pl -- Base64 encoding and decoding
      • aggregate.pl
      • predicate_options.pl
      • csv.pl
      • pprint.pl
      • atom.pl
      • modules.pl
      • occurs.pl -- Finding and counting sub-terms
      • prolog_xref.pl
      • prolog_colour.pl
      • lazy_lists.pl
      • ugraphs.pl
      • url.pl -- Analysing and constructing URL
      • www_browser.pl
      • prolog_pack.pl
      • git.pl
      • utf8.pl -- UTF-8 encoding/decoding on lists of character codes.
      • quintus.pl
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • prolog_wrap.pl
      • dialect.pl -- Support multiple Prolog dialects
      • date.pl
      • persistency.pl
      • iostream.pl -- Utilities to deal with streams
      • prolog_code.pl
      • strings.pl -- String utilities
      • dif.pl
      • edinburgh.pl
      • terms.pl -- Term manipulation
      • ansi_term.pl
      • threadutil.pl -- Interactive thread utilities
      • prolog_stack.pl
      • prolog_clause.pl
      • prolog_breakpoints.pl
      • wfs.pl -- Well Founded Semantics interface
      • sort.pl
      • dicts.pl
      • varnumbers.pl
      • rbtrees.pl -- Red black trees
      • backcomp.pl -- Backward compatibility
      • charsio.pl -- I/O on Lists of Character Codes
      • base32.pl
      • codesio.pl -- I/O on Lists of Character Codes
      • coinduction.pl
      • heaps.pl
      • statistics.pl
      • when.pl
      • ctypes.pl -- Character code classification
      • readln.pl
      • prolog_jiti.pl
      • listing.pl
      • tables.pl -- XSB interface to tables
      • prolog_coverage.pl
      • make.pl
      • optparse.pl
      • prolog_profile.pl
      • vm.pl
      • hashtable.pl
      • prolog_debug.pl
      • oset.pl
      • qpforeign.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
      • zip.pl
      • intercept.pl -- Intercept and signal interface
      • system.pl
      • rwlocks.pl -- Read/write locks
      • prolog_metainference.pl
      • prolog_codewalk.pl
      • help.pl -- Text based manual
      • qsave.pl
      • writef.pl
      • shell.pl -- Elementary shell commands
      • fastrw.pl
      • files.pl
      • prolog_config.pl
      • increval.pl
      • check.pl
      • portray_text.pl
      • check_installation.pl -- Check installation issues and features
      • edit.pl
      • exceptions.pl
      • nb_set.pl
      • prolog_trace.pl
      • tty.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.