module Async_gc: sig
.. end
finalize f x
is like Gc.finalise f x
, except that the finalizer is guaranteed to
run as an Async job (i.e. without interrupting other Async jobs). Unprotected use of
Gc.finalise
in Async programs is wrong, because finalizers can run at any time and
in any thread.
include Core.Gc
val finalize : ('a -> unit) -> 'a -> unit
finalize f x
is like Gc.finalise f x
, except that the finalizer is guaranteed to
run as an Async job (i.e. without interrupting other Async jobs). Unprotected use of
Gc.finalise
in Async programs is wrong, because finalizers can run at any time and
in any thread.
val finalise : [< `In_async__use_finalize_not_finalise ] ->
'a -> [> `In_async__use_finalize_not_finalise ]
finalise
is rebound to avoid accidental use in Async programs.