cs & thread: repair suspending a thread that is currently in sleep
Thanks to Greg Rosenblatt for the report.
This commit is contained in:
parent
db195a52b5
commit
7a12b4ac93
|
@ -1013,6 +1013,17 @@
|
|||
(goes (lambda () (sync (system-idle-evt))) (lambda () (sync (system-idle-evt))) kill-thread)))
|
||||
(list sleep void))
|
||||
|
||||
;; Suspend and sleep
|
||||
(when (run-unreliable-tests? 'timing)
|
||||
(let ([done? #f])
|
||||
(define t (thread (lambda ()
|
||||
(sleep 0.1)
|
||||
(set! done? #t))))
|
||||
(sync (system-idle-evt))
|
||||
(thread-suspend t)
|
||||
(sleep 0.1)
|
||||
(test #f 'suspended-while-sleeping done?)))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Simple multi-custodian threads
|
||||
|
||||
|
|
|
@ -7663,7 +7663,7 @@
|
|||
(void)))))))
|
||||
(if (not (thread-descheduled? t_0))
|
||||
(do-thread-deschedule! t_0 #f)
|
||||
void)))))
|
||||
(begin (remove-from-sleeping-threads! t_0) void))))))
|
||||
(define 1/thread-resume
|
||||
(let ((thread-resume_0
|
||||
(|#%name|
|
||||
|
|
|
@ -512,6 +512,7 @@
|
|||
[(not (thread-descheduled? t))
|
||||
(do-thread-deschedule! t #f)]
|
||||
[else
|
||||
(remove-from-sleeping-threads! t)
|
||||
void])]))
|
||||
|
||||
(define/who (thread-resume t [benefactor #f])
|
||||
|
|
Loading…
Reference in New Issue
Block a user