From cadacf8dfadd530c5cd12cda11e6ef7d9529d1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Tue, 21 Oct 1997 19:45:40 +0200 Subject: [PATCH] low_make_buf_space() is still not thread-safe. Rev: src/modules/Gz/zlibmod.c:1.14 --- src/modules/Gz/zlibmod.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/Gz/zlibmod.c b/src/modules/Gz/zlibmod.c index d504f31609..a050b61015 100644 --- a/src/modules/Gz/zlibmod.c +++ b/src/modules/Gz/zlibmod.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: zlibmod.c,v 1.13 1997/10/21 17:44:21 grubba Exp $"); +RCSID("$Id: zlibmod.c,v 1.14 1997/10/21 17:45:40 grubba Exp $"); #include "zlib_machine.h" @@ -248,6 +248,7 @@ static int do_inflate(dynamic_buffer *buf, int fail=0; THREADS_ALLOW(); mt_lock(& this->lock); + THREADS_DISALLOW(); if(!this->gz.state) { fail=Z_STREAM_ERROR; @@ -257,9 +258,11 @@ static int do_inflate(dynamic_buffer *buf, char *loc; int ret; loc=low_make_buf_space(BUF,buf); + THREADS_ALLOW(); this->gz.next_out=(Bytef *)loc; this->gz.avail_out=BUF; ret=inflate(& this->gz, flush); + THREADS_DISALLOW(); low_make_buf_space(-this->gz.avail_out,buf); if(ret != Z_OK) { @@ -269,7 +272,6 @@ static int do_inflate(dynamic_buffer *buf, } while(!this->gz.avail_out || flush==Z_FINISH || this->gz.avail_in); } mt_unlock(& this->lock); - THREADS_DISALLOW(); return fail; } -- GitLab