summaryrefslogtreecommitdiff
path: root/libhurd-mm/pager.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhurd-mm/pager.c')
-rw-r--r--libhurd-mm/pager.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libhurd-mm/pager.c b/libhurd-mm/pager.c
index 13f9923..5ac52b3 100644
--- a/libhurd-mm/pager.c
+++ b/libhurd-mm/pager.c
@@ -63,6 +63,7 @@ pager_deinit (struct pager *pager)
if (! map->map_list_next)
/* The last reference. */
{
+ ss_mutex_unlock (&pager->lock);
maps_lock_unlock ();
map_destroy (map);
@@ -70,8 +71,12 @@ pager_deinit (struct pager *pager)
return;
}
- /* This drops PAGER->LOCK. */
+ ss_mutex_unlock (&pager->lock);
+
+ /* It is safe to call with with MAPS_LOCK held as we know that
+ this is not the last refence. */
map_destroy (map);
+
ss_mutex_lock (&pager->lock);
}
}