From 3fb2fbdd20840b8b4c4d96fdd8946283ec33d73d Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Mon, 17 Aug 2015 14:04:51 +0200 Subject: [PATCH gnumach 11/12] fu_locking_issues --- vm/vm_map.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vm/vm_map.c b/vm/vm_map.c index d4ae0f1..9098dfd 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -3235,11 +3235,15 @@ kern_return_t vm_map_copyin( /* * Attempt non-blocking copy-on-write optimizations. */ - + if (src_object) + vm_object_lock(src_object); if (src_destroy && (src_object == VM_OBJECT_NULL || (src_object->temporary && !src_object->use_shared_copy))) { + if (src_object) + vm_object_unlock(src_object); + /* * If we are destroying the source, and the object * is temporary, and not shared writable, @@ -3259,6 +3263,9 @@ kern_return_t vm_map_copyin( goto CopySuccessful; } + if (src_object) + vm_object_unlock(src_object); + if (!was_wired && vm_object_copy_temporary( &new_entry->object.vm_object, -- 2.1.4