@@ -305,15 +305,25 @@ module Ivar : sig
305305 (* * [fill ivar value] is equivalent to
306306 {{!try_fill} [try_fill ivar value |> ignore]}. *)
307307
308- val try_poison : 'a t -> exn -> Printexc .raw_backtrace -> bool
309- (* * [try_poison ivar exn bt] attempts to poison the incremental variable with
310- the specified exception and backtrace. Returns [true] on success and
308+ val try_poison_at : 'a t -> exn -> Printexc .raw_backtrace -> bool
309+ (* * [try_poison_at ivar exn bt] attempts to poison the incremental variable
310+ with the specified exception and backtrace. Returns [true] on success and
311311 [false] in case the variable had already been poisoned or assigned a
312312 value. *)
313313
314- val poison : 'a t -> exn -> Printexc .raw_backtrace -> unit
315- (* * [poison ivar exn bt] is equivalent to
316- {{!try_poison} [try_poison ivar exn bt |> ignore]}. *)
314+ val try_poison : ?callstack : int -> 'a t -> exn -> bool
315+ (* * [try_poison ivar exn] is equivalent to
316+ {{!try_poison_at} [try_poison_at ivar exn (Printexc.get_callstack n)]}
317+ where [n] defaults to [0]. *)
318+
319+ val poison_at : 'a t -> exn -> Printexc .raw_backtrace -> unit
320+ (* * [poison_at ivar exn bt] is equivalent to
321+ {{!try_poison_at} [try_poison_at ivar exn bt |> ignore]}. *)
322+
323+ val poison : ?callstack : int -> 'a t -> exn -> unit
324+ (* * [poison ivar exn] is equivalent to
325+ {{!poison_at} [poison_at ivar exn (Printexc.get_callstack n)]}
326+ where [n] defaults to [0]. *)
317327
318328 val peek_opt : 'a t -> 'a option
319329 (* * [peek_opt ivar] either returns [Some value] in case the variable has been
@@ -351,11 +361,16 @@ module Stream : sig
351361 has been {{!poison} poisoned} in which case only the exception given to
352362 {!poison} will be raised. *)
353363
354- val poison : 'a t -> exn -> Printexc .raw_backtrace -> unit
355- (* * [poison stream exn bt] marks the stream as poisoned at the current
364+ val poison_at : 'a t -> exn -> Printexc .raw_backtrace -> unit
365+ (* * [poison_at stream exn bt] marks the stream as poisoned at the current
356366 position, which means that subsequent attempts to {!push} to the [stream]
357367 will raise the given exception with backtrace. *)
358368
369+ val poison : ?callstack : int -> 'a t -> exn -> unit
370+ (* * [poison stream exn] is equivalent to
371+ {{!poison_at} [poison_at stream exn (Printexc.get_callstack n)]}
372+ where [n] defaults to [0]. *)
373+
359374 type !'a cursor
360375 (* * Represents a (past or current) position in a stream. *)
361376
0 commit comments