summaryrefslogtreecommitdiff
path: root/mach-defpager
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2012-02-08 14:10:36 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-03-26 23:54:31 +0200
commitd60340fe2d156a9a167fc6e19e55e09ae359873d (patch)
tree57edb1f7be5fd4eb38a1eab874bc244d272b59e1 /mach-defpager
parent4f8d31d72708f4ae08913e7f42fdc4e852597ed3 (diff)
Add lock in pager_truncate.
* mach-defpager/default_pager.c (pager_truncate): Add mutex lock.
Diffstat (limited to 'mach-defpager')
-rw-r--r--mach-defpager/default_pager.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index 4b5aff89..ca53ac6c 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -1056,6 +1056,7 @@ pager_truncate(dpager_t pager, vm_size_t new_size) /* in pages */
}
}
+ mutex_lock(&pager->lock); /* XXX lock_write */
old_size = pager->size;
if (INDIRECT_PAGEMAP(old_size))
@@ -1124,6 +1125,7 @@ pager_truncate(dpager_t pager, vm_size_t new_size) /* in pages */
}
pager->size = new_size;
+ mutex_unlock(&pager->lock);
#ifdef CHECKSUM
#error write me