When run.out is missing in &grade_test, just return an error that
[pintos-anon] / solutions / p2.patch
index 578ff5e2cf06af02b26fb25f055b1cab3955bb7e..1de7f57166997b328d144103fc38c95349532a8b 100644 (file)
@@ -1,16 +1,3 @@
-Index: src/constants.h
-===================================================================
-RCS file: /afs/ir.stanford.edu/users/b/l/blp/private/cvs/pintos/src/constants.h,v
-retrieving revision 1.4
-diff -u -p -r1.4 constants.h
---- src/constants.h    19 Oct 2004 17:37:30 -0000      1.4
-+++ src/constants.h    1 Jan 2005 02:13:41 -0000
-@@ -8,4 +8,4 @@
- /*#define MACRONAME 1 */
- /* Uncomment if if you've implemented thread_join(). */
--/*#define THREAD_JOIN_IMPLEMENTED 1*/
-+#define THREAD_JOIN_IMPLEMENTED 1
 Index: src/threads/synch.c
 ===================================================================
 RCS file: /afs/ir.stanford.edu/users/b/l/blp/private/cvs/pintos/src/threads/synch.c,v
@@ -157,12 +144,12 @@ diff -u -p -r1.48 thread.c
    schedule ();
    NOT_REACHED ();
  }
-@@ -300,6 +323,26 @@ kernel_thread (thread_func *function, vo
-   function (aux);       /* Execute the thread function. */
-   thread_exit ();       /* If function() returns, kill the thread. */
- }
-+
-+/* Waits for thread with tid CHILD_TID to die. */
+@@ -283,8 +290,22 @@ thread_block (void) 
+    This function will be implemented in problem 1-2.  For now, it
+    does nothing. */
+-void
+-thread_join (tid_t child_tid UNUSED) 
+-{
 +int
 +thread_join (tid_t child_tid) 
 +{
@@ -176,14 +163,13 @@ diff -u -p -r1.48 thread.c
 +      if (child->tid == child_tid) 
 +        {
 +          latch_acquire (&child->ready_to_die);
-+          return child->exit_code; 
++          return child->exit_code;
 +        }
 +    }
 +  return -1;
-+}
\f
- /* Returns the running thread. */
- struct thread *
+ }
+ /* Sets the current thread's priority to NEW_PRIORITY. */
 @@ -336,6 +379,12 @@ init_thread (struct thread *t, const cha
    strlcpy (t->name, name, sizeof t->name);
    t->stack = (uint8_t *) t + PGSIZE;
@@ -237,14 +223,14 @@ diff -u -p -r1.28 thread.h
  
      /* Owned by thread.c. */
 @@ -120,7 +132,7 @@ void thread_exit (void) NO_RETURN;
+ void thread_exit (void) NO_RETURN;
  void thread_yield (void);
  
- /* This function will be implemented in problem 1-2. */
 -void thread_join (tid_t);
 +int thread_join (tid_t);
  
- /* These functions will be implemented in problem 1-3. */
  void thread_set_priority (int);
+ int thread_get_priority (void);
 Index: src/userprog/exception.c
 ===================================================================
 RCS file: /afs/ir.stanford.edu/users/b/l/blp/private/cvs/pintos/src/userprog/exception.c,v