summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-04-12 18:43:59 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-04-13 16:51:33 +0100
commita050e87fb505c3f818f19112bf84ec8811c546fc (patch)
tree0016549b43f318953fef821507e2940e0e5e2aa1
parent6356f587c7288adae0d53f3fbdd5610b2b62d14b (diff)
downloadlibguestfs-a050e87fb505c3f818f19112bf84ec8811c546fc.tar.gz
libguestfs-a050e87fb505c3f818f19112bf84ec8811c546fc.tar.xz
libguestfs-a050e87fb505c3f818f19112bf84ec8811c546fc.zip
extra-tests: ocaml: Use a short delay instead of Thread.yield.
On the new faster computer, Thread.yield wasn't yielding, so the second thread would block the main test from proceeding (only when run under valgrind however). (cherry picked from commit 5b414f581f1e40f91e44914776b119ce3ef6594c)
-rw-r--r--ocaml/t/guestfs_070_threads.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/ocaml/t/guestfs_070_threads.ml b/ocaml/t/guestfs_070_threads.ml
index 414b0232..8b22f938 100644
--- a/ocaml/t/guestfs_070_threads.ml
+++ b/ocaml/t/guestfs_070_threads.ml
@@ -25,7 +25,8 @@ let thread = Thread.create (
fun () ->
while true do
Gc.compact ();
- ignore (Array.init 1000 (fun i -> Thread.yield (); String.create (8*i)))
+ ignore (Array.init 1000 (fun i -> String.create (8*i)));
+ Thread.delay 0.001
done
) ()