thread: add some reminders to the implementation

These comments were meant to be part of e60a78aad9.
This commit is contained in:
Matthew Flatt 2018-10-07 09:28:09 -06:00
parent 62c63de7a2
commit c102673339
2 changed files with 7 additions and 1 deletions

View File

@ -129,6 +129,8 @@
(check who custodian? c)
(atomically
(do-custodian-shutdown-all c))
;; Set in "thread.rkt" to check whether the current thread
;; should be swapped out
(post-shutdown-action))
;; In atomic mode

View File

@ -401,6 +401,8 @@
(add-to-sleeping-threads! t (sandman-merge-timeout #f timeout-at)))
(when (eq? t (current-thread))
(thread-did-work!))
;; Beware that this thunk is not used when a thread is descheduled
;; but a custodian callback
(lambda ()
(when (eq? t (current-thread))
(when (positive? (current-atomic))
@ -454,7 +456,9 @@
;; in atomic mode
;; Returns a thunk to call to handle the case that
;; the current thread is suspended
;; the current thread is suspended; beware that the
;; thunk is not used when `custodian-shutdown-all`
;; suspends a thread
(define (do-thread-suspend t)
(assert-atomic-mode)
(cond