1 #-sb-thread
(invoke-restart 'run-tests
::skip-file
)
3 (setq *evaluator-mode
* :compile
)
4 ;; example from lp#2029306
7 (defun clear-registers (&optional a b c d e f g h i j k l m n o p q
)
8 (values q p o n m l k j i h g f e d c b a
))
11 (setf *x
* (make-hash-table))
13 (sb-ext:finalize
*x
* (lambda () (error "final")) :dont-save t
)
15 (sb-sys:scrub-control-stack
)
16 (assert (sb-ext:cancel-finalization
*x
*)))
18 (defglobal *runflag
* t
)
20 (sb-thread:make-thread
22 (loop while
*runflag
* do
(gc :full t
) (sleep 0.01)))
26 (sb-thread:make-thread
28 (let ((*x
* nil
)) (loop while
*runflag
* do
(test))))
31 (test-util:with-test
(:name
:finalizer-insertion-race
)
32 (sleep 8) ; arbitrary time to let the test run
34 (mapc 'sb-thread
:join-thread
(list *thr1
* *thr2
*)))