mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-16 06:12:25 -08:00
In the queue, when the first process of the queue leaves it, it awakes the next one in line to test its condition.
This commit is contained in:
parent
abf312520f
commit
323822457c
1 changed files with 8 additions and 7 deletions
|
|
@ -271,13 +271,14 @@ ecl_wait_on(cl_env_ptr env, cl_object (*condition)(cl_env_ptr, cl_object), cl_ob
|
|||
own_process->process.queue_record = record;
|
||||
ECL_RPLACD(record, Cnil);
|
||||
|
||||
/* 5) We know that we are aborting when we exit this
|
||||
* function with output == Cnil. In this case, if we
|
||||
* got a wakeup signal, this could be lost. The safe
|
||||
* thing to do is to wakeup the first process, because
|
||||
* first processes are always allowed to check for the
|
||||
* condition */
|
||||
if (Null(output) && (firstone == record)) {
|
||||
/* 5) When this process exits, it may be because it
|
||||
* aborts (which we know because output == Cnil), or
|
||||
* because the condition is satisfied. In both cases
|
||||
* we allow the first in the queue to test again its
|
||||
* condition. This is needed for objects, such as
|
||||
* semaphores, where the condition may be satisfied
|
||||
* more than once. */
|
||||
if (/*Null(output) &&*/ (firstone == record)) {
|
||||
ecl_wakeup_waiters(the_env, o, 0, ECL_WAKEUP_ONE);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue