blob: 0d5e935ad224658b6bd64a92d92f6df4c83f6b5e (
plain)
1
2
3
4
5
6
7
8
9
10
|
<h4 class="subsection">Processes and Threads</h4> <p>Because threads were a relatively late addition to Emacs Lisp, and due to the way dynamic binding was sometimes used in conjunction with <code>accept-process-output</code>, by default a process is locked to the thread that created it. When a process is locked to a thread, output from the process can only be accepted by that thread. </p> <p>A Lisp program can specify to which thread a process is to be locked, or instruct Emacs to unlock a process, in which case its output can be processed by any thread. Only a single thread will wait for output from a given process at one time—once one thread begins waiting for output, the process is temporarily locked until <code>accept-process-output</code> or <code>sit-for</code> returns. </p> <p>If the thread exits, all the processes locked to it are unlocked. </p> <dl> <dt id="process-thread">Function: <strong>process-thread</strong> <em>process</em>
</dt> <dd><p>Return the thread to which <var>process</var> is locked. If <var>process</var> is unlocked, return <code>nil</code>. </p></dd>
</dl> <dl> <dt id="set-process-thread">Function: <strong>set-process-thread</strong> <em>process thread</em>
</dt> <dd><p>Set the locking thread of <var>process</var> to <var>thread</var>. <var>thread</var> may be <code>nil</code>, in which case the process is unlocked. </p></dd>
</dl><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Processes-and-Threads.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Processes-and-Threads.html</a>
</p>
</div>
|