Skip to content

Commit

Permalink
Try to make test :deferrables-unblocked-by-lock more robust
Browse files Browse the repository at this point in the history
  - Use a join thread, not a kill thread, so that we do not kill the
    background thread while it is currently performing the actual
    test.

  - Give the thread more time to start up, to make it more likely
    that its GRAB-MUTEX call needs to wait -- otherwise deferrables would
    not be unblocked.
  • Loading branch information
lichtblau committed Sep 30, 2012
1 parent 991c149 commit ba534ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/threads.impure.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

(with-test (:name (:interrupt-thread :deferrables-unblocked-by-lock))
(let ((lock (sb-thread::make-mutex))
(thread (make-kill-thread (lambda ()
(thread (make-join-thread (lambda ()
(loop (sleep 1))))))
(sb-thread::grab-mutex lock)
(sb-thread:interrupt-thread thread
Expand All @@ -95,7 +95,7 @@
(sb-thread::grab-mutex lock)
(check-deferrables-unblocked-or-lose 0)
(sb-thread:abort-thread)))
(sleep 1)
(sleep 3)
(sb-thread::release-mutex lock)))

;;; compare-and-swap
Expand Down

0 comments on commit ba534ac

Please sign in to comment.