diff options
| author | Tom Tromey | 2012-08-23 01:06:11 -0600 |
|---|---|---|
| committer | Tom Tromey | 2012-08-23 01:06:11 -0600 |
| commit | 66ddd174be5aaf2c70666adc4046615cf3413d5b (patch) | |
| tree | 878459fe2f27aec58f8dd6fe2d55d8d4a66fda74 /doc | |
| parent | 68608de20310c42c5719fe99e556847fac9dd1f2 (diff) | |
| download | emacs-66ddd174be5aaf2c70666adc4046615cf3413d5b.tar.gz emacs-66ddd174be5aaf2c70666adc4046615cf3413d5b.zip | |
document process-thread and set-process-thread
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/processes.texi | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 217f9f9eaee..80a3d0f985d 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -1174,6 +1174,7 @@ shell command. | |||
| 1174 | * Filter Functions:: Filter functions accept output from the process. | 1174 | * Filter Functions:: Filter functions accept output from the process. |
| 1175 | * Decoding Output:: Filters can get unibyte or multibyte strings. | 1175 | * Decoding Output:: Filters can get unibyte or multibyte strings. |
| 1176 | * Accepting Output:: How to wait until process output arrives. | 1176 | * Accepting Output:: How to wait until process output arrives. |
| 1177 | * Processes and Threads:: How processes and threads interact. | ||
| 1177 | @end menu | 1178 | @end menu |
| 1178 | 1179 | ||
| 1179 | @node Process Buffers | 1180 | @node Process Buffers |
| @@ -1504,6 +1505,35 @@ did get some output, or @code{nil} if the timeout expired before output | |||
| 1504 | arrived. | 1505 | arrived. |
| 1505 | @end defun | 1506 | @end defun |
| 1506 | 1507 | ||
| 1508 | @node Processes and Threads | ||
| 1509 | @subsection Processes and Threads | ||
| 1510 | @cindex processes, threads | ||
| 1511 | |||
| 1512 | Because threads were a relatively late addition to Emacs Lisp, and | ||
| 1513 | due to the way dynamic binding was sometimes used in conjunction with | ||
| 1514 | @code{accept-process-output}, by default a process is locked to the | ||
| 1515 | thread that created it. When a process is locked to a thread, output | ||
| 1516 | from the process can only be accepted by that thread. | ||
| 1517 | |||
| 1518 | A Lisp program can specify to which thread a process is to be | ||
| 1519 | locked, or instruct Emacs to unlock a process, in which case its | ||
| 1520 | output can be processed by any thread. Only a single thread will wait | ||
| 1521 | for output from a given process at one time---once one thread begins | ||
| 1522 | waiting for output, the process is temporarily locked until | ||
| 1523 | @code{accept-process-output} or @code{sit-for} returns. | ||
| 1524 | |||
| 1525 | If the thread exits, all the processes locked to it are unlocked. | ||
| 1526 | |||
| 1527 | @defun process-thread process | ||
| 1528 | Return the thread to which @var{process} is locked. If @var{process} | ||
| 1529 | is unlocked, return @code{nil}. | ||
| 1530 | @end defun | ||
| 1531 | |||
| 1532 | @defun set-process-thread process thread | ||
| 1533 | Set the locking thread of @var{process} to @var{thread}. @var{thread} | ||
| 1534 | may be @code{nil}, in which case the process is unlocked. | ||
| 1535 | @end defun | ||
| 1536 | |||
| 1507 | @node Sentinels | 1537 | @node Sentinels |
| 1508 | @section Sentinels: Detecting Process Status Changes | 1538 | @section Sentinels: Detecting Process Status Changes |
| 1509 | @cindex process sentinel | 1539 | @cindex process sentinel |