Ajout Lock/Unlock

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1695 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 1997-09-02 08:51:09 +00:00
parent 61165f474f
commit d75918f7e4
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,7 @@ value md5_chan(vchan, len) /* ML */
long toread, read;
char buffer[4096];
Lock(chan);
MD5Init(&ctx);
toread = Long_val(len);
while (toread > 0) {
@ -53,6 +54,7 @@ value md5_chan(vchan, len) /* ML */
}
res = alloc_string(16);
MD5Final(&Byte_u(res, 0), &ctx);
Unlock(chan);
return res;
}