From d60340fe2d156a9a167fc6e19e55e09ae359873d Mon Sep 17 00:00:00 2001 From: Maksym Planeta Date: Wed, 8 Feb 2012 14:10:36 +0200 Subject: Add lock in pager_truncate. * mach-defpager/default_pager.c (pager_truncate): Add mutex lock. --- mach-defpager/default_pager.c | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.3