From 542f5fd3d232f6396a902345f199586938ae125e Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 9 Dec 2014 06:06:51 -0700 Subject: [PATCH] ffi/unsafe/custodian: doc clarifications --- pkgs/racket-doc/scribblings/foreign/custodian.scrbl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/racket-doc/scribblings/foreign/custodian.scrbl b/pkgs/racket-doc/scribblings/foreign/custodian.scrbl index 6e285eebc4..0e1a516e6e 100644 --- a/pkgs/racket-doc/scribblings/foreign/custodian.scrbl +++ b/pkgs/racket-doc/scribblings/foreign/custodian.scrbl @@ -31,10 +31,14 @@ custodian, even if @racket[weak?] is @racket[#f]; see Normally, @racket[weak?] should be false. To trigger actions based on finalization or custodian shutdown---whichever happens first---leave -@racket[weak?] as @racket[#f] and have a finalizer cancel the shutdown -action via @racket[unregister-custodian-shutdown]. Otherwise, a -not-yet-run finalizer may remain pending after the custodian is -shutdown.} +@racket[weak?] as @racket[#f] and have a finalizer run in atomic mode +and cancel the shutdown action via +@racket[unregister-custodian-shutdown]. If @racket[weak?] is true or +if the finalizer is not run in atomic mode, then there's no guarantee +that either of the custodian or finalizer callbacks has completed by +the time that the custodian shutdown has completed; @racket[v] might +be no longer registered to the custodian, while the finalizer for +@racket[v] might be still running or merely queued to run.} @defproc[(unregister-custodian-shutdown [v any/c]