Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > e3d62627d1d1aab7ab1be2dd7f65a872 > files > 348

ecl-10.4.1-1.fc14.x86_64.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>mp:interrupt-process</title><link rel="stylesheet" href="ecl.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The ECL manual"><link rel="up" href="ch19s02.html" title="4.2.&#160;MP Reference"><link rel="prev" href="re16.html" title="mp:exit-process"><link rel="next" href="re18.html" title="mp:get-lock"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><code class="function">mp:interrupt-process</code></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re16.html">Prev</a>&#160;</td><th width="60%" align="center">4.2.&#160;MP Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="re18.html">Next</a></td></tr></table><hr></div><div class="refentry" title="mp:interrupt-process"><a name="ref.mp.interrupt-process"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p><code class="function">mp:interrupt-process</code> &#8212; Interrupt a task.</p></div><div class="refsynopsisdiv" title="Function"><h2>Function</h2><div class="funcsynopsis"><p><code class="funcdef">(mp:interrupt-process</code> <var class="pdparam">process</var>) &#8658; <var class="pdparam">function</var>)</p></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="replaceable"><code>process</code></em></span></p></td><td><p>An object of type
    <em class="replaceable"><code>mp:process</code></em>.</p></td></tr><tr><td><p><span class="term"><em class="replaceable"><code>function</code></em></span></p></td><td><p>A function, which is to be executed in the interrupted
    process.</p></td></tr></tbody></table></div></div><div class="refsect1" title="Description"><a name="id660214"></a><h2>Description</h2><p>This function sends a signal to a running task. When the task is
  free to process that signal, it will stop whatever it is doing and
  execute the given <em class="replaceable"><code>function</code></em>.</p></div><div class="refsect1" title="Example"><a name="id660229"></a><h2>Example</h2><p>Kill a task that is doing nothing (See <a class="xref" href="re24.html" title="mp:process-kill"><code class="function">mp:process-kill</code></a>).</p><pre class="programlisting">
(flet ((task-to-be-killed ()
         (loop (sleep 1)) ; Infinite loop
	 ))
  (let ((task (mp:process-run-function 'background #'task-to-be-killed)))
    (sleep 10)
    (mp:interrupt-process task 'mp:exit-process)))
</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re16.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch19s02.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="re18.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><code class="function">mp:exit-process</code>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<code class="function">mp:get-lock</code></td></tr></table></div></body></html>