mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
Unlocked mutexes don't have owners
* libguile/threads.c (scm_unlock_mutex) (scm_timed_wait_condition_variable): Unlocked mutexes should never have owners.
This commit is contained in:
parent
4110e7bbb1
commit
1ed9dea34a
1 changed files with 10 additions and 4 deletions
|
@ -1268,8 +1268,11 @@ SCM_DEFINE (scm_unlock_mutex, "unlock-mutex", 1, 0, 0, (SCM mutex),
|
|||
if (m->level > 0)
|
||||
m->level--;
|
||||
if (m->level == 0)
|
||||
/* Change the owner of MUTEX. */
|
||||
m->owner = unblock_from_queue (m->waiting);
|
||||
/* Wake up one waiter. */
|
||||
{
|
||||
m->owner = SCM_BOOL_F;
|
||||
unblock_from_queue (m->waiting);
|
||||
}
|
||||
|
||||
scm_i_pthread_mutex_unlock (&m->lock);
|
||||
|
||||
|
@ -1414,8 +1417,11 @@ SCM_DEFINE (scm_timed_wait_condition_variable, "wait-condition-variable", 2, 1,
|
|||
if (m->level > 0)
|
||||
m->level--;
|
||||
if (m->level == 0)
|
||||
/* Change the owner of MUTEX. */
|
||||
m->owner = unblock_from_queue (m->waiting);
|
||||
{
|
||||
m->owner = SCM_BOOL_F;
|
||||
/* Wake up one waiter. */
|
||||
unblock_from_queue (m->waiting);
|
||||
}
|
||||
|
||||
t->block_asyncs++;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue