Dynamic space relocation, part 1 of 2
[sbcl.git] / tests / condition-wait-sigcont.lisp
blobc4c4312441b891e21c06021533b2cc1555b31f2b
1 ;;;; prior to sbcl 0.9.15.39 a SIGSTOP and SIGCONT while waiting
2 ;;;; on CONDITION-WAIT caused a spurious wakeup.
4 ;;;; This software is part of the SBCL system. See the README file for
5 ;;;; more information.
6 ;;;;
7 ;;;; While most of SBCL is derived from the CMU CL system, the test
8 ;;;; files (like this one) were written from scratch after the fork
9 ;;;; from CMU CL.
10 ;;;
11 ;;;; This software is in the public domain and is provided with
12 ;;;; absoluely no warranty. See the COPYING and CREDITS files for
13 ;;;; more information.
15 (use-package :sb-thread)
17 (defvar *queue* (make-waitqueue))
18 (defvar *lock* (make-mutex :name "lock"))
20 (with-mutex (*lock*)
21 (write-line "/waiting")
22 (force-output)
23 (delete-file "condition-wait-sigcont.tmp")
24 #+sb-thread
25 (condition-wait *queue* *lock*)
26 #-sb-thread
27 (loop (sleep 10))
28 (write-line "/woken")
29 (force-output)
30 (with-open-file (f "condition-wait-sigcont.tmp" :direction :output)
31 (write-line "woken!" f)))
33 (write-line "/oops!")
34 (force-output)
36 ;; sleep a bit so our runner can kill us
37 (sleep 10)
38 (exit)