Update of /cvsroot/sbcl/sbcl/src/code
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv8861/src/code
Modified Files:
target-thread.lisp
Log Message:
1.0.37.16: fix build
* Oops. Missing package prefixes and wrong slot type
for SEMAPHORE-WAITCOUNT.
Index: target-thread.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/target-thread.lisp,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -d -r1.126 -r1.127
--- target-thread.lisp 29 Mar 2010 10:54:08 -0000 1.126
+++ target-thread.lisp 29 Mar 2010 15:31:25 -0000 1.127
@@ -644,7 +644,7 @@
future."
(name nil :type (or null simple-string))
(%count 0 :type (integer 0))
- (waitcount 0 :type (integer 0))
+ (waitcount 0 :type sb!vm:word)
(mutex (make-mutex))
(queue (make-waitqueue)))
@@ -681,15 +681,16 @@
;; Need to use ATOMIC-INCF despite the lock, because on our
;; way out from here we might not be locked anymore -- so
;; another thread might be tweaking this in parallel using
- ;; ATOMIC-DECF.
- (atomic-incf (semaphore-waitcount semaphore))
+ ;; ATOMIC-DECF. No danger over overflow, since there it
+ ;; at most one increment per thread waiting on the semaphore.
+ (sb!ext:atomic-incf (semaphore-waitcount semaphore))
(loop until (plusp (setf count (semaphore-%count semaphore)))
do (condition-wait (semaphore-queue semaphore)
(semaphore-mutex semaphore)))
(setf (semaphore-%count semaphore) (1- count)))
;; Need to use ATOMIC-DECF instead of DECF, as CONDITION-WAIT
;; may unwind without the lock being held due to timeouts.
- (atomic-decf (semaphore-waitcount semaphore)))))))
+ (sb!ext:atomic-decf (semaphore-waitcount semaphore)))))))
(defun try-semaphore (semaphore &optional (n 1))
#!+sb-doc
|