Changeset 7851


Ignore:
Timestamp:
Dec 9, 2007, 1:39:41 PM (13 years ago)
Author:
gb
Message:

Conditionalize lock accounting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-0/l0-misc.lisp

    r7744 r7851  
    2323
    2424;; Cold-load lossage.
     25#+lock-accounting
    2526(setq *lock-conses* (make-list 20))
    2627
    2728;;; Per-thread consing, for lock-ownership tracking.
     29#+lock-accounting
    2830(defun %lock-cons (x y)
    2931  (let* ((cell (prog1 *lock-conses*
     
    533535
    534536(defun note-lock-wait (lock)
    535   (setq *locks-pending* (%lock-cons lock *locks-pending*)))
     537  #+lock-accounting
     538  (setq *locks-pending* (%lock-cons lock *locks-pending*))
     539  #-lock-accounting (declare (ignore lock)))
    536540
    537541(defun note-lock-held ()
     542  #+lock-accounting
    538543  (let* ((p *locks-pending*))
    539544    (setq *locks-pending* (cdr *locks-pending*))
     
    542547
    543548(defun note-lock-released ()
     549  #+lock-accounting
    544550  (setf (car *locks-held*) nil
    545551        *locks-held* (cdr *locks-held*)))
     
    650656       (cond ((eql p owner)
    651657              (incf (%get-natural ptr target::lockptr.count))
     658              #+lock-accounting
    652659              (setq *locks-held* (%lock-cons lock *locks-held*))
    653660              (if flag (setf (lock-acquisition.status flag) t))
     
    659666                  (setf (%get-ptr ptr target::lockptr.owner) p
    660667                        (%get-natural ptr target::lockptr.count) 1)
     668                  #+lock-accounting
    661669                  (setq *locks-held* (%lock-cons lock *locks-held*))
    662670                  (if flag (setf (lock-acquisition.status flag) t)))
     
    678686     (cond ((eql (%get-object ptr target::lockptr.owner) self)
    679687            (incf (%get-natural ptr target::lockptr.count))
     688            #+lock-accounting*
    680689            (setq *locks-held* (%lock-cons lock *locks-held*))
    681690            (if flag (setf (lock-acquisition.status flag) t))
     
    684693            (when (eql 0 (%ptr-store-conditional ptr futex-avail futex-locked))
    685694              (%set-object ptr target::lockptr.owner self)
    686               (setf (%get-natural ptr target::lockptr.count) 1)             
     695              (setf (%get-natural ptr target::lockptr.count) 1)
     696              #+lock-accounting
    687697              (setq *locks-held* (%lock-cons lock *locks-held*))
    688698              (if flag (setf (lock-acquisition.status flag) t))
Note: See TracChangeset for help on using the changeset viewer.