Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jleong/change exit behavior #114

Merged
merged 12 commits into from
Feb 22, 2017
Prev Previous commit
Next Next commit
Remove unused filesys_lock in thread
  • Loading branch information
omegaphoenix committed Feb 21, 2017
commit 23cf7c5ab72efcc9143765509f066028fbdeadbf
1 change: 0 additions & 1 deletion src/threads/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,6 @@ static void init_thread(struct thread *t, const char *name, int priority) {
/* Block process_wait of parent until this process is ready to die. */
sema_init(&t->wait_sema, 0);
sema_init(&t->done_sema, 1);
lock_init(&t->filesys_lock);
t->loaded = false;
t->waited_on = false;
t->num_files = 0;
Expand Down
1 change: 0 additions & 1 deletion src/threads/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ struct thread {
struct semaphore exec_load; /*!< Semaphore for checking when executable has loaded. */
bool loaded; /*!< Check if exec loaded successfully. */
struct file *executable; /*!< Executable to keep open until done. */
struct lock filesys_lock; /*!< Lock for filesys calls. */
/**@}*/

#ifdef USERPROG
Expand Down
1 change: 0 additions & 1 deletion src/userprog/DESIGNDOC
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ In our thread struct, we included these attributes and their following descripti
struct semaphore exec_load; /*!< Semaphore for checking when executable has loaded. */
bool loaded; /*!< Check if exec loaded successfully. */
struct file *executable; /*!< Executable to keep open until done. */
struct lock filesys_lock; /*!< Lock for filesys calls. */
/**@}*/


Expand Down
2 changes: 0 additions & 2 deletions src/userprog/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,11 @@ void *get_third_arg(struct intr_frame *f) {
static variables go out of memory. */
void acquire_file_lock(void) {
lock_acquire(&filesys_lock);
lock_acquire(&thread_current()->filesys_lock);
}

/*! Release file locks. See comment in acquire_file_lock. */
void release_file_lock(void) {
lock_release(&filesys_lock);
lock_release(&thread_current()->filesys_lock);
}

/*! Terminates Pintos. Should be seldom used due to loss of information on
Expand Down