From: Nikodemus S. <de...@us...> - 2006-08-18 16:22:04
|
Update of /cvsroot/sbcl/sbcl/tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15785/tests Added Files: condition-wait-sigcont.lisp threads.test.sh Log Message: 0.9.15.39: futex(FUTEX_WAIT) calls need to check for EINTR * Caused bogus wakeups in CONDITION-WAIT on Linux from SIGCONT. --- NEW FILE: condition-wait-sigcont.lisp --- ;;;; prior to sbcl 0.9.15.39 a SIGSTOP and SIGCONT while waiting ;;;; on CONDITION-WAIT caused a spurious wakeup. ;;;; This software is part of the SBCL system. See the README file for ;;;; more information. ;;;; ;;;; While most of SBCL is derived from the CMU CL system, the test ;;;; files (like this one) were written from scratch after the fork ;;;; from CMU CL. ;;; ;;;; This software is in the public domain and is provided with ;;;; absoluely no warranty. See the COPYING and CREDITS files for ;;;; more information. (use-package :sb-thread) (defvar *queue* (make-waitqueue)) (defvar *lock* (make-mutex :name "lock")) (with-mutex (*lock*) (write-line "/waiting") (force-output) (delete-file "condition-wait-sigcont.tmp") (condition-wait *queue* *lock*) (write-line "/woken") (force-output) (with-open-file (f "condition-wait-sigcont.tmp" :direction :output) (write-line "woken!" f))) (write-line "/oops!") (force-output) ;; sleep a bit so our runner can kill us (sleep 10) (quit) --- NEW FILE: threads.test.sh --- #!/bin/sh # This software is part of the SBCL system. See the README file for # more information. # # While most of SBCL is derived from the CMU CL system, the test # files (like this one) were written from scratch after the fork # from CMU CL. # # This software is in the public domain and is provided with # absolutely no warranty. See the COPYING and CREDITS files for # more information. flag="condition-wait-sigcont.tmp" touch $flag ../src/runtime/sbcl --core ../output/sbcl.core --load condition-wait-sigcont.lisp & sb_pid=$! while [ -f $flag ]; do sleep 1; done sleep 1 kill -STOP $sb_pid kill -CONT $sb_pid sleep 2 kill -KILL $sb_pid if [ -f $flag ] then rm $flag exit 1 # error else exit 104 # success fi |