mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2025-12-06 02:40:26 -08:00
mp:get-wait: fix return value
Should be `t` according to the documentation while we were returning the lock itself.
This commit is contained in:
parent
0885862e40
commit
889f93fc08
2 changed files with 6 additions and 6 deletions
|
|
@ -172,7 +172,7 @@ mp_get_lock_nowait(cl_object lock)
|
|||
}
|
||||
ecl_enable_interrupts_env(env);
|
||||
if (rc == ECL_MUTEX_SUCCESS) {
|
||||
ecl_return1(env,lock);
|
||||
ecl_return1(env, ECL_T);
|
||||
} else if (rc == ECL_MUTEX_LOCKED) {
|
||||
ecl_return1(env, ECL_NIL);
|
||||
#if defined(ECL_MUTEX_DEADLOCK)
|
||||
|
|
@ -205,7 +205,7 @@ mp_get_lock_wait(cl_object lock)
|
|||
lock->lock.counter++;
|
||||
lock->lock.owner = own_process;
|
||||
ecl_enable_interrupts_env(env);
|
||||
ecl_return1(env, lock);
|
||||
ecl_return1(env, ECL_T);
|
||||
#if defined(ECL_MUTEX_DEADLOCK)
|
||||
} else if (ecl_unlikely(rc == ECL_MUTEX_DEADLOCK)) {
|
||||
FEerror_not_a_recursive_lock(lock);
|
||||
|
|
@ -301,7 +301,7 @@ mp_get_lock_timedwait(cl_object lock, cl_object timeout)
|
|||
lock->lock.counter++;
|
||||
lock->lock.owner = own_process;
|
||||
ecl_enable_interrupts_env(env);
|
||||
ecl_return1(env, lock);
|
||||
ecl_return1(env, ECL_T);
|
||||
} else if (rc == ECL_MUTEX_TIMEOUT) {
|
||||
ecl_return1(env, ECL_NIL);
|
||||
#if defined(ECL_MUTEX_DEADLOCK)
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ block or give up if @var{lock} is already taken. If @var{wait} is
|
|||
@code{nil}, immediately return, if @var{wait} is a real number
|
||||
@var{wait} specifies a timeout in seconds and otherwise block until the
|
||||
lock becomes available. If @var{lock} can't be acquired return
|
||||
@code{nil}. Succesful operation returns @code{t}. Will signal an error
|
||||
@code{nil}. Successful operation returns @code{t}. Will signal an error
|
||||
if the mutex is non-recursive and current thread already owns the lock.
|
||||
@end defun
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue