Ignore:
Timestamp:
Jan 12, 2022, 9:30:48 PM (2 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
42daeb4
Parents:
1959528 (diff), 07a1e7a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Peter A. Buhr <pabuhr@…> (01/12/22 18:35:04)
git-committer:
Peter A. Buhr <pabuhr@…> (01/12/22 21:30:48)
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/locks.hfa

    r1959528 r00f5fde  
    3131                // previous thread to acquire the lock
    3232                void* prev_thrd;
     33                // keep track of number of times we had to spin, just in case the number is unexpectedly huge
     34                size_t spin_count;
    3335        #endif
    3436};
     
    4850        static inline void ?{}( __spinlock_t & this ) {
    4951                this.lock = 0;
     52                #ifdef __CFA_DEBUG__
     53                        this.spin_count = 0;
     54                #endif
    5055        }
    5156
     
    7277                for ( unsigned int i = 1;; i += 1 ) {
    7378                        if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break;
     79                        #ifdef __CFA_DEBUG__
     80                                this.spin_count++;
     81                        #endif
    7482                        #ifndef NOEXPBACK
    7583                                // exponential spin
Note: See TracChangeset for help on using the changeset viewer.