From: Ben Pfaff Date: Tue, 18 Jan 2005 17:26:47 +0000 (+0000) Subject: In all the variants of the basic test for part 1-1, release the lock X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19fe10d57674f3711affc583ca21ca7dd9c3c798;p=pintos-anon In all the variants of the basic test for part 1-1, release the lock when we're done with it. This shouldn't be necessary, but not releasing the lock is a corner case that we don't necessarily want the students to have to handle. --- diff --git a/grading/threads/alarm-multiple.c b/grading/threads/alarm-multiple.c index aaa3cc8..6e7c3d4 100644 --- a/grading/threads/alarm-multiple.c +++ b/grading/threads/alarm-multiple.c @@ -130,6 +130,7 @@ test_sleep (int thread_cnt, int iterations) printf ("Test complete.\n"); + lock_release (&test.output_lock); free (output); free (threads); } diff --git a/grading/threads/alarm-single.c b/grading/threads/alarm-single.c index 4681d89..aff2064 100644 --- a/grading/threads/alarm-single.c +++ b/grading/threads/alarm-single.c @@ -130,6 +130,7 @@ test_sleep (int thread_cnt, int iterations) printf ("Test complete.\n"); + lock_release (&test.output_lock); free (output); free (threads); } diff --git a/src/tests/threads/p1-1.c b/src/tests/threads/p1-1.c index 2aeb910..627bba5 100644 --- a/src/tests/threads/p1-1.c +++ b/src/tests/threads/p1-1.c @@ -134,6 +134,7 @@ test_sleep (int thread_cnt, int iterations) printf ("Test complete.\n"); + lock_release (&test.output_lock); free (output); free (threads); } diff --git a/src/threads/test.c b/src/threads/test.c index 2aeb910..627bba5 100644 --- a/src/threads/test.c +++ b/src/threads/test.c @@ -134,6 +134,7 @@ test_sleep (int thread_cnt, int iterations) printf ("Test complete.\n"); + lock_release (&test.output_lock); free (output); free (threads); }