From bb3545ddf7556d0c876af05729d56a841c2abad7 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 12 Aug 2012 20:25:47 -0600 Subject: [PATCH] ffi/unsafe/custodian: `#:atexit?' -> `#:at-exit?' --- collects/ffi/unsafe/com.rkt | 2 +- collects/ffi/unsafe/custodian.rkt | 4 ++-- collects/scribblings/foreign/custodian.scrbl | 4 ++-- collects/tests/racket/ffi-custodian.rkt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/collects/ffi/unsafe/com.rkt b/collects/ffi/unsafe/com.rkt index 726144c78d..09fb54ffd5 100644 --- a/collects/ffi/unsafe/com.rkt +++ b/collects/ffi/unsafe/com.rkt @@ -559,7 +559,7 @@ (define impl (com-object-impl obj)) (set-com-impl-mref! impl - (register-custodian-shutdown impl impl-release #:atexit? #t)) + (register-custodian-shutdown impl impl-release #:at-exit? #t)) ;; If we don't finalize the object, then it could ;; happen that the object becomes unreachable and ;; pointers that the object references could be diff --git a/collects/ffi/unsafe/custodian.rkt b/collects/ffi/unsafe/custodian.rkt index 3b1ecac455..619d04e418 100644 --- a/collects/ffi/unsafe/custodian.rkt +++ b/collects/ffi/unsafe/custodian.rkt @@ -26,11 +26,11 @@ (cast shutdown-callback (_fun #:atomic? #t _racket _racket -> _void) _fpointer)) (define (register-custodian-shutdown obj proc [custodian (current-custodian)] - #:atexit? [atexit? #f] + #:at-exit? [at-exit? #f] #:weak? [weak? #f]) (define proc+self (cons proc shutdown-callback)) ; proc as data -> ffi callback retained - (if atexit? + (if at-exit? (scheme_add_managed_close_on_exit custodian obj shutdown_callback proc+self) (scheme_add_managed custodian diff --git a/collects/scribblings/foreign/custodian.scrbl b/collects/scribblings/foreign/custodian.scrbl index 4ce8370b5e..6e285eebc4 100644 --- a/collects/scribblings/foreign/custodian.scrbl +++ b/collects/scribblings/foreign/custodian.scrbl @@ -11,7 +11,7 @@ registering shutdown callbacks with custodians.} @defproc[(register-custodian-shutdown [v any/c] [callback (any/c . -> . any)] [custodian custodian? (current-custodian)] - [#:atexit? atexit? any/c #f] + [#:at-exit? at-exit? any/c #f] [#:weak? weak? any/c #f]) cpointer?]{ @@ -20,7 +20,7 @@ unspecified Racket thread) to @racket[v] when @racket[custodian] is shutdown. The result is a pointer that can be supplied to @racket[unregister-custodian-shutdown] to remove the registration. -If @racket[atexit?] is true, then @racket[callback] is applied when +If @racket[at-exit?] is true, then @racket[callback] is applied when Racket exits, even if the custodian is not explicitly shut down. If @racket[weak?] is true, then @racket[callback] may not be called diff --git a/collects/tests/racket/ffi-custodian.rkt b/collects/tests/racket/ffi-custodian.rkt index 1cb840ccef..eb3ab20a9a 100644 --- a/collects/tests/racket/ffi-custodian.rkt +++ b/collects/tests/racket/ffi-custodian.rkt @@ -13,7 +13,7 @@ (when done? (error "duplicate!")) (set! done? (equal? x '(1 . 2)))) c - #:atexit? #t)) + #:at-exit? #t)) (unregister-custodian-shutdown val (reg)) (void (reg))