Skip to content

Commit

Permalink
Merge pull request ish-app#611 from saagarjha/lock
Browse files Browse the repository at this point in the history
Replace read lock with write lock in mm_copy
  • Loading branch information
tbodt authored Jan 10, 2020
2 parents 06ecbdc + 955d653 commit e901a34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ struct mm *mm_copy(struct mm *mm) {
new_mm->refcount = 1;
mem_init(&new_mm->mem);
fd_retain(new_mm->exefile);
read_wrlock(&mm->mem.lock);
write_wrlock(&mm->mem.lock);
pt_copy_on_write(&mm->mem, &new_mm->mem, 0, MEM_PAGES);
read_wrunlock(&mm->mem.lock);
write_wrunlock(&mm->mem.lock);
return new_mm;
}

Expand Down

0 comments on commit e901a34

Please sign in to comment.