package pyml

  1. Overview
  2. Docs

Module Py.GilSource

Sourcetype t
Sourceval ensure : unit -> t

ensure () ensures that the current thread holds the global interpreter lock and hence can call the Python C API in a safe way. Wrapper for PyGILState_Ensure

Sourceval release : t -> unit

release t releases any resource acquired by ensure. Wrapper for PyGILState_Release

Sourceval check : unit -> bool

check () returns true if the current thread holds the global interpreter lock. Wrapper for PyGILState_Check

Sourceval with_lock : (unit -> 'a) -> 'a

with_lock f runs f ensuring that we hold the global interpreter lock to do so. If the lock needs to be acquired it is released once f completes or if f raises an exception.

OCaml

Innovation. Community. Security.