From 0a0d8bb18f65f1f378bcab6b0d948049dd828582 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 22 Apr 1995 21:07:12 +0000 Subject: [PATCH] Close the qid and tqueue associated with a readahead thread when the thread finishes. This will fix the known bug of exhausting the set of available qids, and it will also fix a previously unnoticed memory leak. --- v7/src/microcode/os2conio.c | 7 ++++++- v7/src/microcode/os2pipe.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/v7/src/microcode/os2conio.c b/v7/src/microcode/os2conio.c index 05875a9c6..1ca959dfd 100644 --- a/v7/src/microcode/os2conio.c +++ b/v7/src/microcode/os2conio.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: os2conio.c,v 1.5 1995/01/05 23:39:57 cph Exp $ +$Id: os2conio.c,v 1.6 1995/04/22 21:06:57 cph Exp $ Copyright (c) 1994-95 Massachusetts Institute of Technology @@ -147,6 +147,11 @@ console_thread (void * arg) } } } + { + tqueue_t * tqueue = (OS2_qid_tqueue (console_writer_qid)); + OS2_close_qid (console_writer_qid); + OS2_close_std_tqueue (tqueue); + } OS2_endthread (); } diff --git a/v7/src/microcode/os2pipe.c b/v7/src/microcode/os2pipe.c index 88e7f8e89..c0053a0eb 100644 --- a/v7/src/microcode/os2pipe.c +++ b/v7/src/microcode/os2pipe.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: os2pipe.c,v 1.3 1995/01/05 23:43:32 cph Exp $ +$Id: os2pipe.c,v 1.4 1995/04/22 21:07:12 cph Exp $ Copyright (c) 1994-95 Massachusetts Institute of Technology @@ -131,5 +131,10 @@ input_pipe_thread (void * arg) break; OS2_wait_for_readahead_ack (qid); } + { + tqueue_t * tqueue = (OS2_qid_tqueue (qid)); + OS2_close_qid (qid); + OS2_close_std_tqueue (tqueue); + } OS2_endthread (); } -- 2.25.1