Branch: Tag:

1997-08-31

1997-08-31 22:25:33 by Per Hedbor <ph@opera.com>

Removed some unnessesary locks, and fixed a severe bug (THIS was used
when running unlocked, this caused very obscure bugs in the thread
library)

Rev: src/modules/Gz/zlibmod.c:1.10

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: zlibmod.c,v 1.9 1997/07/19 20:29:59 hubbe Exp $"); + RCSID("$Id: zlibmod.c,v 1.10 1997/08/31 22:25:33 per Exp $");      #include "zlib_machine.h"   
46:       if(THIS->gz.state)    { -  mt_lock(& THIS->lock); + /* mt_lock(& THIS->lock); */    deflateEnd(&THIS->gz); -  mt_unlock(& THIS->lock); + /* mt_unlock(& THIS->lock); */    }       if(args)
68:    THIS->gz.opaque=THIS;       pop_n_elems(args); -  mt_lock(& THIS->lock); + /* mt_lock(& THIS->lock); */    level=deflateInit(&THIS->gz, level); -  mt_unlock(& THIS->lock); + /* mt_unlock(& THIS->lock); */    switch(level)    {    case Z_OK:
195:      static void exit_gz_deflate(struct object *o)   { -  mt_lock(& THIS->lock); + /* mt_lock(& THIS->lock); */    deflateEnd(&THIS->gz); -  mt_unlock(& THIS->lock); + /* mt_unlock(& THIS->lock); */   }      /*******************************************************************/
208:    int tmp;    if(THIS->gz.state)    { -  mt_lock(& THIS->lock); + /* mt_lock(& THIS->lock); */    inflateEnd(&THIS->gz); -  mt_unlock(& THIS->lock); + /* mt_unlock(& THIS->lock); */    }      
219:    THIS->gz.opaque=THIS;       pop_n_elems(args); -  mt_lock(& THIS->lock); + /* mt_lock(& THIS->lock); */    tmp=inflateInit(& THIS->gz); -  mt_unlock(& THIS->lock); + /* mt_unlock(& THIS->lock); */    switch(tmp)    {    case Z_OK:
244:    int flush)   {    int fail=0; -  +     THREADS_ALLOW(); -  mt_lock(& THIS->lock); +  mt_lock(& this->lock);    if(!this->gz.state)    {    fail=Z_STREAM_ERROR;
267:    }    } while(!this->gz.avail_out || flush==Z_FINISH || this->gz.avail_in);    } -  mt_unlock(& THIS->lock); +  mt_unlock(& this->lock);    THREADS_DISALLOW();    return fail;   }
327:      static void exit_gz_inflate(struct object *o)   { -  mt_lock(& THIS->lock); + /* mt_lock(& THIS->lock); */    inflateEnd(& THIS->gz); -  mt_unlock(& THIS->lock); + /* mt_unlock(& THIS->lock); */   }      #endif