Skip to content

Commit

Permalink
Remove what little extra locking stuff remained. It still appears in …
Browse files Browse the repository at this point in the history
…/proc/ish for backwards compatibility, but does nothing.
  • Loading branch information
Mike Miller committed Oct 27, 2022
1 parent f578a0a commit d79dbcf
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
7 changes: 0 additions & 7 deletions emu/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ void mem_init(struct mem *mem) {
}

void mem_destroy(struct mem *mem) {
//int elock_fail = 0;
// if(doEnableExtraLocking)
// elock_fail = extra_lockf(0);

write_lock(&mem->lock);
while((critical_region_count(current) > 1) && (current->pid > 1) ){ // Wait for now, task is in one or more critical sections, and/or has locks
nanosleep(&lock_pause, NULL);
Expand Down Expand Up @@ -85,9 +81,6 @@ void mem_destroy(struct mem *mem) {

//modify_critical_region_counter(current, -1, __FILE__, __LINE__);

//if((doEnableExtraLocking) && (!elock_fail))
// extra_unlockf(0);

}

#define PGDIR_TOP(page) ((page) >> 10)
Expand Down
13 changes: 0 additions & 13 deletions fs/proc/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ static int proc_pid_stat_show(struct proc_entry *entry, struct proc_data *buf) {
struct task *task = proc_get_task(entry);
if ((task == NULL) || (task->exiting == true))
return _ESRCH;
//int elock_fail;
// if(doEnableExtraLocking)
// elock_fail = extra_lockf(entry->pid);

////modify_critical_region_counter(task, 1, __FILE__, __LINE__);
lock(&task->general_lock, 0);
Expand Down Expand Up @@ -114,9 +111,6 @@ static int proc_pid_stat_show(struct proc_entry *entry, struct proc_data *buf) {
// that's enough for now
proc_printf(buf, "\n");

//if((doEnableExtraLocking) && (!elock_fail))
// extra_unlockf(entry->pid);

//unlock(&task->sighand->lock);
unlock(&task->group->lock);
unlock(&task->general_lock);
Expand Down Expand Up @@ -175,10 +169,6 @@ static int proc_pid_cmdline_show(struct proc_entry *entry, struct proc_data *buf
int err = 0;
lock(&task->general_lock, 0);

//int elock_fail = 0;
// if(doEnableExtraLocking)
// elock_fail = extra_lockf(task->pid);

if (task->mm == NULL)
goto out_free_task;

Expand All @@ -195,10 +185,7 @@ static int proc_pid_cmdline_show(struct proc_entry *entry, struct proc_data *buf
out_free_task:
unlock(&task->general_lock);
//proc_put_task(task);
////modify_critical_region_counter(task, -1, __FILE__, __LINE__);

//if((doEnableExtraLocking) && (!elock_fail))
// extra_unlockf(task->pid);
return err;
}

Expand Down
12 changes: 0 additions & 12 deletions kernel/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ void task_destroy(struct task *task) {
if(!pthread_mutex_trylock(&task->death_lock))
return; // Task is already in the process of being deleted, most likely by do_exit(). -mke
task->exiting = true;
int elock_fail = 0;
if(doEnableExtraLocking)
elock_fail = extra_lockf(task->pid, __FILE__, __LINE__);

bool signal_pending = !!(current->pending & ~current->blocked);
while((critical_region_count(task) > 1) || (locks_held_count(task)) || (signal_pending)) { // Wait for now, task is in one or more critical sections, and/or has locks
Expand Down Expand Up @@ -192,8 +189,6 @@ void task_destroy(struct task *task) {
signal_pending = !!(current->blocked);
}
list_remove(&pid->alive);
if((doEnableExtraLocking) && (!elock_fail))
extra_unlockf(task->pid, __FILE__, __LINE__);

if(Ishould)
unlock(&pids_lock);
Expand Down Expand Up @@ -251,17 +246,10 @@ void task_run_current() {
static void *task_thread(void *task) {

current = task;
// int elock_fail = 0;

current->critical_region.count = 0; // Is this needed? -mke

//////modify_critical_region_counter(task, 1);
// if(doEnableExtraLocking)
// elock_fail = extra_lockf(current->pid);
update_thread_name();
//////modify_critical_region_counter(task, -1);
//if((doEnableExtraLocking) && (!elock_fail))
// extra_unlockf(0);

task_run_current();
die("task_thread returned"); // above function call should never return
Expand Down

0 comments on commit d79dbcf

Please sign in to comment.