

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>threaded_wait/1 &mdash; The Logtalk Handbook v3.42.0-b02 documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  
  
  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <!-- begin favicon -->
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
    <link rel="manifest" href="/site.webmanifest" />
    <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
    <meta name="msapplication-TileColor" content="#355b95" />
    <meta name="theme-color" content="#ffffff" />
    <!-- end favicon -->
    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="threaded_notify/1" href="threaded_notify_1.html" />
    <link rel="prev" title="threaded_cancel/1" href="threaded_cancel_1.html" />
   
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../index.html" class="icon icon-home" alt="Documentation Home"> The Logtalk Handbook
          

          
            
            <img src="../../_static/logtalk.gif" class="logo" alt="Logo"/>
          
          </a>

          
            
            
              <div class="version">
                3.42.0
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
    
            
            
              
            
            
              <p class="caption"><span class="caption-text">Contents</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../userman/index.html">User Manual</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Reference Manual</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../grammar.html">Grammar</a></li>
<li class="toctree-l2"><a class="reference internal" href="../control/index.html">Control constructs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../directives/index.html">Directives</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Built-in predicates</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="enumerating_entity_predicates.html">Enumerating objects, categories and protocols</a></li>
<li class="toctree-l3"><a class="reference internal" href="enumerating_entity_property_predicates.html">Enumerating objects, categories and protocols properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="creating_entity_predicates.html">Creating new objects, categories and protocols</a></li>
<li class="toctree-l3"><a class="reference internal" href="abolishing_entity_predicates.html">Abolishing objects, categories and protocols</a></li>
<li class="toctree-l3"><a class="reference internal" href="entity_relation_predicates.html">Objects, categories, and protocols relations</a></li>
<li class="toctree-l3"><a class="reference internal" href="event_handling_predicates.html">Event handling</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="multi_threading_predicates.html">Multi-threading</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="threaded_1.html">threaded/1</a></li>
<li class="toctree-l4"><a class="reference internal" href="threaded_call_1_2.html">threaded_call/1-2</a></li>
<li class="toctree-l4"><a class="reference internal" href="threaded_once_1_2.html">threaded_once/1-2</a></li>
<li class="toctree-l4"><a class="reference internal" href="threaded_ignore_1.html">threaded_ignore/1</a></li>
<li class="toctree-l4"><a class="reference internal" href="threaded_exit_1_2.html">threaded_exit/1-2</a></li>
<li class="toctree-l4"><a class="reference internal" href="threaded_peek_1_2.html">threaded_peek/1-2</a></li>
<li class="toctree-l4"><a class="reference internal" href="threaded_cancel_1.html">threaded_cancel/1</a></li>
<li class="toctree-l4 current"><a class="current reference internal" href="#">threaded_wait/1</a></li>
<li class="toctree-l4"><a class="reference internal" href="threaded_notify_1.html">threaded_notify/1</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="engine_predicates.html">Multi-threading engines</a></li>
<li class="toctree-l3"><a class="reference internal" href="compiling_predicates.html">Compiling and loading source files</a></li>
<li class="toctree-l3"><a class="reference internal" href="flag_predicates.html">Flags</a></li>
<li class="toctree-l3"><a class="reference internal" href="linter_predicates.html">Linter</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../methods/index.html">Built-in methods</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../faq/index.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../devtools/index.html">Developer Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../libraries/index.html">Libraries</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary.html">Glossary</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../bibliography.html">Bibliography</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../genindex.html">Index</a></li>
</ul>

            
          
	<p class="caption"><span class="caption-text">External Contents</span></p>
    <a href="../docs/index.html">APIs</a>
    <a href="https://logtalk.org">Logtalk website</a>
    <a href="https://github.com/LogtalkDotOrg/logtalk3">GitHub repo</a>
  
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">The Logtalk Handbook</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../index.html">Reference Manual</a> &raquo;</li>
        
          <li><a href="index.html">Built-in predicates</a> &raquo;</li>
        
          <li><a href="multi_threading_predicates.html">Multi-threading</a> &raquo;</li>
        
      <li>threaded_wait/1</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            
              <a href="https://github.com/LogtalkDotOrg/logtalk3/blob/master/manuals/sources/refman/predicates/threaded_wait_1.rst" class="fa fa-github"> Edit on GitHub</a>
            
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="threaded-wait-1">
<span id="predicates-threaded-wait-1"></span><span id="index-0"></span><h1>threaded_wait/1<a class="headerlink" href="#threaded-wait-1" title="Permalink to this headline">¶</a></h1>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<div class="highlight-logtalk notranslate"><div class="highlight"><pre><span></span><span class="k">threaded_wait</span>(<span class="nv">Term</span>)
<span class="k">threaded_wait</span>([<span class="nv">Term</span>| <span class="nv">Terms</span>])
</pre></div>
</div>
<p>Suspends the thread making the call until a notification is received
that unifies with <code class="docutils literal notranslate"><span class="pre">Term</span></code>. The call must be made within the same object
(<a class="reference internal" href="../../glossary.html#term-this"><span class="xref std std-term">this</span></a>) containing the calls to the
<a class="reference internal" href="threaded_notify_1.html#predicates-threaded-notify-1"><span class="std std-ref">threaded_notify/1</span></a> predicate that will
eventually send the notification. The argument may also be a list of
notifications, <code class="docutils literal notranslate"><span class="pre">[Term|</span> <span class="pre">Terms]</span></code>. In this case, the thread making the
call will suspend until all notifications in the list are received.</p>
</div>
<div class="section" id="modes-and-number-of-proofs">
<h2>Modes and number of proofs<a class="headerlink" href="#modes-and-number-of-proofs" title="Permalink to this headline">¶</a></h2>
<div class="highlight-logtalk notranslate"><div class="highlight"><pre><span></span><span class="k">threaded_wait</span>(<span class="o">?</span>term) <span class="o">-</span> one
<span class="k">threaded_wait</span>(<span class="o">+</span>list(term)) <span class="o">-</span> one
</pre></div>
</div>
</div>
<div class="section" id="errors">
<h2>Errors<a class="headerlink" href="#errors" title="Permalink to this headline">¶</a></h2>
<p>(none)</p>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-logtalk notranslate"><div class="highlight"><pre><span></span><span class="c">% wait until the &quot;data_available&quot; notification is received:</span>
..., <span class="k">threaded_wait</span>(data_available), ...
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="threaded_notify_1.html#predicates-threaded-notify-1"><span class="std std-ref">threaded_notify/1</span></a></p>
</div>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="threaded_notify_1.html" class="btn btn-neutral float-right" title="threaded_notify/1" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="threaded_cancel_1.html" class="btn btn-neutral float-left" title="threaded_cancel/1" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        
        &copy; Copyright 1998-2020, Paulo Moura

    </p>
  </div>
    
    
    
    Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>