[Openmcl-cvs-notifications] r14540 - /trunk/source/level-0/l0-misc.lisp

wws at clozure.com wws at clozure.com
Fri Dec 31 16:24:56 CST 2010


Author: wws
Date: Fri Dec 31 16:24:56 2010
New Revision: 14540

Log:
Change futex values from natural to long in rwlock code. This prevents type=
 errors on 64-bit machines with lots of lock contention.

Modified:
    trunk/source/level-0/l0-misc.lisp

Modified: trunk/source/level-0/l0-misc.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/level-0/l0-misc.lisp (original)
+++ trunk/source/level-0/l0-misc.lisp Fri Dec 31 16:24:56 2010
@@ -895,7 +895,7 @@
                  (setf (lock-acquisition.status flag) t))
                t)
            (incf (%get-natural ptr target::rwlock.blocked-writers))
-           (let* ((waitval (%get-natural write-signal 0)))
+           (let* ((waitval (%get-signed-long write-signal 0)))
              (%unlock-futex ptr)
              (with-process-whostate ((rwlock-write-whostate lock))
                (let* ((*interrupt-level* level))
@@ -969,7 +969,7 @@
                t)
            (declare (fixnum state))
            (incf (%get-natural ptr target::rwlock.blocked-readers))
-           (let* ((waitval (%get-natural reader-signal 0)))
+           (let* ((waitval (%get-signed-long reader-signal 0)))
              (%unlock-futex ptr)
              (let* ((*interrupt-level* level))
                (futex-wait reader-signal waitval (rwlock-read-whostate loc=
k))))
@@ -1066,7 +1066,7 @@
              (setq signal writer-signal wakeup 1)
              (if (> nreaders 0)
                (setq signal reader-signal wakeup #$INT_MAX)))))
-       (when signal (incf (%get-signed-natural signal 0)))
+       (when signal (incf (%get-signed-long signal 0)))
        (%unlock-futex ptr)
        (when signal (futex-wake signal wakeup))
        t)))))



More information about the Openmcl-cvs-notifications mailing list