Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor bugfixes
[rsync/rsync.git]
/
lib
/
zlib.c
diff --git
a/lib/zlib.c
b/lib/zlib.c
index
9d96513
..
82e82c7
100644
(file)
--- a/
lib/zlib.c
+++ b/
lib/zlib.c
@@
-3943,7
+3943,9
@@
z_stream *z; /* for zfree function */
/* build fixed tables only once--keep them here */
/* 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;
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 */
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--;
while (++fixed_lock > 1)
fixed_lock--;
+#endif
if (!fixed_built)
{
int k; /* temporary variable */
if (!fixed_built)
{
int k; /* temporary variable */
@@
-4018,7
+4022,9
@@
inflate_huft * FAR *td; /* distance tree result */
/* done */
fixed_built = 1;
}
/* done */
fixed_built = 1;
}
+#ifdef MULTI_THREADED
fixed_lock--;
fixed_lock--;
+#endif
*bl = fixed_bl;
*bd = fixed_bd;
*tl = fixed_tl;
*bl = fixed_bl;
*bd = fixed_bd;
*tl = fixed_tl;