diff options
author | Paul Mackerras <paulus@samba.org> | 1997-04-11 06:18:02 +0000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 1997-04-11 06:18:02 +0000 |
commit | 774ef68f00d3b83a869119720af93b6d57731041 (patch) | |
tree | 80689bc5d76910e9b5ddd1758e6b77c81198083f /lib | |
parent | b8d4524b4f8c0080ed34b59d90d8345d5c84916b (diff) | |
download | rsync-774ef68f00d3b83a869119720af93b6d57731041.tar.gz rsync-774ef68f00d3b83a869119720af93b6d57731041.tar.bz2 rsync-774ef68f00d3b83a869119720af93b6d57731041.zip |
minor bugfixes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/zlib.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -3943,7 +3943,9 @@ z_stream *z; /* for zfree function */ /* build fixed tables only once--keep them here */ -local int fixed_lock = 0; +#ifdef MULTI_THREADED +local volatile int fixed_lock = 0; +#endif local int fixed_built = 0; #define FIXEDH 530 /* number of hufts used by fixed tables */ local uInt fixed_left = FIXEDH; @@ -3984,8 +3986,10 @@ inflate_huft * FAR *tl; /* literal/length tree result */ inflate_huft * FAR *td; /* distance tree result */ { /* build fixed tables if not built already--lock out other instances */ +#ifdef MULTI_THREADED while (++fixed_lock > 1) fixed_lock--; +#endif if (!fixed_built) { int k; /* temporary variable */ @@ -4018,7 +4022,9 @@ inflate_huft * FAR *td; /* distance tree result */ /* done */ fixed_built = 1; } +#ifdef MULTI_THREADED fixed_lock--; +#endif *bl = fixed_bl; *bd = fixed_bd; *tl = fixed_tl; |