From c4df6186aaebe94436efe49f42149bb90f084d73 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 18 Jan 2005 17:26:47 +0000 Subject: [PATCH] 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. --- grading/threads/alarm-multiple.c | 1 + grading/threads/alarm-single.c | 1 + src/tests/threads/p1-1.c | 1 + src/threads/test.c | 1 + 4 files changed, 4 insertions(+) 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); } -- 2.30.2