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:
Marius Gerbershagen 2023-07-08 15:22:39 +02:00
parent 0885862e40
commit 889f93fc08
2 changed files with 6 additions and 6 deletions

View file

@ -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)

View file

@ -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