Skip to content

Commit

Permalink
Remove confusing comments
Browse files Browse the repository at this point in the history
Without an explanation (which is not even present in the original
commit message), the remarks about locking the current task being
unnecessary is confusing at best.

The basic understanding of the code actually suggests that locking
the current task is essential for the mutual exclusion in the mapping
and unmapping routines.

Change-Id: Ia83231367bb0e4c987b75a31fdde38501e43c543
  • Loading branch information
martin-decky authored and kk-infra committed Jun 19, 2024
1 parent 1a8a001 commit 3e6ea05
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/kern/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ Task::sys_map(L4_fpage::Rights rights, Syscall_frame *f, Utcb *utcb)
// always take lock from task with the lower memory address first
Lock_guard_2<Lock> guard;

// FIXME: avoid locking the current task, it is not needed
if (!guard.check_and_lock(&existence_lock, &from->existence_lock))
return commit_result(-L4_err::EInval);

Expand Down Expand Up @@ -481,7 +480,6 @@ Task::sys_unmap(Syscall_frame *f, Utcb *utcb)
Ref_ptr<Task> self(this);
Lock_guard<Lock> guard;

// FIXME: avoid locking the current task, it is not needed
if (!guard.check_and_lock(&existence_lock))
return commit_error(utcb, L4_error::Not_existent);

Expand Down

0 comments on commit 3e6ea05

Please sign in to comment.