diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-16 19:23:17 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-16 19:23:17 +0100 |
commit | 35ac5568e6fd81bab048686163a9ae173ba06f45 (patch) | |
tree | 7e8f980085cdbcd623b8f1f070706fb5bd9a77e1 /mach-defpager | |
parent | 5b4eb54f379241e4ce56200fc6bbddca3576a07d (diff) | |
download | hurd-35ac5568e6fd81bab048686163a9ae173ba06f45.tar.gz hurd-35ac5568e6fd81bab048686163a9ae173ba06f45.tar.bz2 hurd-35ac5568e6fd81bab048686163a9ae173ba06f45.zip |
mach-defpager: Fix crash on pthread_cond_broadcast
We need to keep ds locked, otherwise it might disappear before we have a
chance to broadcast the condition.
Diffstat (limited to 'mach-defpager')
-rw-r--r-- | mach-defpager/default_pager.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index 02d1f1a9..4ba9763f 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -1964,8 +1964,8 @@ void pager_port_unlock(ds) default_pager_t ds; { ds->seqno++; - dstruct_unlock(ds); pthread_cond_broadcast(&ds->waiting_seqno); + dstruct_unlock(ds); } /* @@ -1997,8 +1997,8 @@ void pager_port_finish_read(ds) { dstruct_lock(ds); if (--ds->readers == 0) { - dstruct_unlock(ds); pthread_cond_broadcast(&ds->waiting_read); + dstruct_unlock(ds); } else { dstruct_unlock(ds); @@ -2034,8 +2034,8 @@ void pager_port_finish_write(ds) { dstruct_lock(ds); if (--ds->writers == 0) { - dstruct_unlock(ds); pthread_cond_broadcast(&ds->waiting_write); + dstruct_unlock(ds); } else { dstruct_unlock(ds); |