cs: wake up main thread blocked on fsemaphore
If a future posts to an fsemaphore that the main thread is waiting on but went to sleep, then be sure to wake up the main thread. Relevant to #2957
This commit is contained in:
parent
6db1bdda1b
commit
a319b7e073
|
@ -53,12 +53,13 @@
|
|||
(set-fsemaphore-dependents! fs (hash-remove deps f))
|
||||
(future-notify-dependent f)]
|
||||
[else
|
||||
(set-fsemaphore-c! fs 1)
|
||||
(when b
|
||||
;; This is a kind of broadcast wakeup, and then the
|
||||
;; awakened threads will compete for the fsemaphore:
|
||||
(set-fsemaphore-dep-box! fs #f)
|
||||
(set-box! b #t))
|
||||
(set-fsemaphore-c! fs 1)])]
|
||||
(set-box! b #t)
|
||||
(wakeup-this-place))])]
|
||||
[else
|
||||
(set-fsemaphore-c! fs (add1 c))])))
|
||||
|
||||
|
|
|
@ -43,7 +43,8 @@
|
|||
(provide future*-lock
|
||||
set-future*-state!
|
||||
future-suspend
|
||||
future-notify-dependent))
|
||||
future-notify-dependent
|
||||
wakeup-this-place))
|
||||
|
||||
(define (init-future-place!)
|
||||
(init-future-logging-place!))
|
||||
|
|
Loading…
Reference in New Issue
Block a user