Ajout Lock/Unlock
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1695 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
61165f474f
commit
d75918f7e4
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue