ocamllabs/ocaml-ctypes — pull request #164 by yallop (2014-07-09 01:19:52+00:00)
Title: Support for releasing the runtime lock

This change adds a new parameter to `Foreign`, [`release_runtime_lock:bool`](https://github.com/yallop/ocaml-ctypes/blob/ce075572/src/ctypes-foreign-unthreaded/foreign.mli#L15), which adds calls to [`caml_release_runtime_system`](http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual033.html#htoc293) and `caml_acquire_runtime_system` around the [call into C](https://github.com/yallop/ocaml-ctypes/blob/ce075572/src/ctypes-foreign-base/ffi_call_stubs.c#L348-L361).

Limitations: this patch only supports foreign (dynamic) binding, not stub generation, and does not add support for using callbacks together with lock release.

Fixes #16 (with the above caveats).