Changeset 418d31ac
- Timestamp:
- Jan 10, 2022, 7:10:43 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 5b7a3662
- Parents:
- 078fb05
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/locks.hfa
r078fb05 r418d31ac 31 31 // previous thread to acquire the lock 32 32 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; 33 35 #endif 34 36 }; … … 48 50 static inline void ?{}( __spinlock_t & this ) { 49 51 this.lock = 0; 52 #ifdef __CFA_DEBUG__ 53 this.spin_count = 0; 54 #endif 50 55 } 51 56 … … 72 77 for ( unsigned int i = 1;; i += 1 ) { 73 78 if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break; 79 #ifdef __CFA_DEBUG__ 80 this.spin_count++; 81 #endif 74 82 #ifndef NOEXPBACK 75 83 // exponential spin
Note: See TracChangeset
for help on using the changeset viewer.