mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
ocaml: Replace old enter/leave_blocking_section calls
Since OCaml 4 the old and confusing caml_enter_blocking_section and caml_leave_blocking_section calls have been replaced with caml_release_runtime_system and caml_acquire_runtime_system (in that order). Use the new names.
This commit is contained in:
@@ -429,6 +429,7 @@ and generate_ocaml_c () =
|
||||
#include <caml/memory.h>
|
||||
#include <caml/mlvalues.h>
|
||||
#include <caml/signals.h>
|
||||
#include <caml/threads.h>
|
||||
|
||||
#include <guestfs.h>
|
||||
#include \"guestfs-utils.h\"
|
||||
@@ -689,12 +690,12 @@ copy_table (char * const * argv)
|
||||
pr "\n";
|
||||
|
||||
if blocking then
|
||||
pr " caml_enter_blocking_section ();\n";
|
||||
pr " caml_release_runtime_system ();\n";
|
||||
pr " r = %s " c_function;
|
||||
generate_c_call_args ~handle:"g" style;
|
||||
pr ";\n";
|
||||
if blocking then
|
||||
pr " caml_leave_blocking_section ();\n";
|
||||
pr " caml_acquire_runtime_system ();\n";
|
||||
|
||||
(* Free strings if we copied them above. *)
|
||||
List.iter (
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <caml/mlvalues.h>
|
||||
#include <caml/printexc.h>
|
||||
#include <caml/signals.h>
|
||||
#include <caml/threads.h>
|
||||
#include <caml/unixsupport.h>
|
||||
|
||||
#include "guestfs-c.h"
|
||||
@@ -395,12 +396,12 @@ event_callback_wrapper (guestfs_h *g,
|
||||
/* Ensure we are holding the GC lock before any GC operations are
|
||||
* possible. (RHBZ#725824)
|
||||
*/
|
||||
caml_leave_blocking_section ();
|
||||
caml_acquire_runtime_system ();
|
||||
|
||||
event_callback_wrapper_locked (g, data, event, event_handle, flags,
|
||||
buf, buf_len, array, array_len);
|
||||
|
||||
caml_enter_blocking_section ();
|
||||
caml_release_runtime_system ();
|
||||
}
|
||||
|
||||
value
|
||||
|
||||
Reference in New Issue
Block a user