ocaml: Fix locking in event callbacks.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 26 Jul 2011 17:57:19 +0000 (18:57 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 27 Jul 2011 14:08:15 +0000 (15:08 +0100)
commitb36c2d176f52fcc6413edd513d4a3a5969e7c265
treef1f1f19679ca8b2683cfb1f0c0d758935b758458
parentdb7ae9aa0ac22c570cbfb92933af78a94824eadc
ocaml: Fix locking in event callbacks.

We weren't acquiring the GC lock around some allocations, resulting in
segfaults when an event callback ran at the same time as a main thread
allocation or garbage collection.

In particular this fixes a noticable crash in guestfs-browser.
(cherry picked from commit 2b8b3f9794ceb43eabd3083e225c669896d8b186)
ocaml/guestfs_c.c