Add a control lock mutex for protecting certain control variables.

This commit is contained in:
Con Kolivas 2013-09-01 12:11:51 +10:00
parent 37ef39e70a
commit 4db4641dae
2 changed files with 3 additions and 0 deletions

View file

@ -373,6 +373,8 @@ struct rzip_control {
uchar *salt_pass;
int salt_pass_len;
uchar *hash;
pthread_mutex_t control_lock;
unsigned char eof;
unsigned char magic_written;

1
rzip.c
View file

@ -918,6 +918,7 @@ bool rzip_fd(rzip_control *control, int fd_in, int fd_out)
double chunkmbs;
i64 free_space;
init_mutex(control, &control->control_lock);
if (!NO_MD5)
md5_init_ctx(&control->ctx);
init_mutex(control, &control->cksumlock);