Changeset ced5e2a for libcfa


Ignore:
Timestamp:
Jun 8, 2022, 4:22:24 PM (23 months ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
ae06e0b
Parents:
e5d9274
Message:

removed debug fields from spinlock_t

Location:
libcfa/src
Files:
3 edited

Legend:

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

    re5d9274 rced5e2a  
    2626        // Wrap in struct to prevent false sharing with debug info
    2727        volatile bool lock;
    28         #ifdef __CFA_DEBUG__
    29                 // previous function to acquire the lock
    30                 const char * prev_name;
    31                 // previous thread to acquire the lock
    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;
    35         #endif
    3628};
    3729
     
    4032                extern void disable_interrupts() OPTIONAL_THREAD;
    4133                extern void enable_interrupts( bool poll = true ) OPTIONAL_THREAD;
    42 
    43                 #ifdef __CFA_DEBUG__
    44                         void __cfaabi_dbg_record_lock(__spinlock_t & this, const char prev_name[]);
    45                 #else
    46                         #define __cfaabi_dbg_record_lock(x, y)
    47                 #endif
     34                #define __cfaabi_dbg_record_lock(x, y)
    4835        }
    4936
    5037        static inline void ?{}( __spinlock_t & this ) {
    5138                this.lock = 0;
    52                 #ifdef __CFA_DEBUG__
    53                         this.spin_count = 0;
    54                 #endif
    5539        }
    5640
     
    7761                for ( unsigned int i = 1;; i += 1 ) {
    7862                        if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break;
    79                         #ifdef __CFA_DEBUG__
    80                                 this.spin_count++;
    81                         #endif
    8263                        #ifndef NOEXPBACK
    8364                                // exponential spin
  • libcfa/src/concurrency/kernel.cfa

    re5d9274 rced5e2a  
    834834#endif
    835835
    836 
    837 
    838 //-----------------------------------------------------------------------------
    839 // Debug
    840 __cfaabi_dbg_debug_do(
    841         extern "C" {
    842                 void __cfaabi_dbg_record_lock(__spinlock_t & this, const char prev_name[]) {
    843                         this.prev_name = prev_name;
    844                         this.prev_thrd = kernelTLS().this_thread;
    845                 }
    846         }
    847 )
    848 
    849836//-----------------------------------------------------------------------------
    850837// Debug
  • libcfa/src/startup.cfa

    re5d9274 rced5e2a  
    6363
    6464struct __spinlock_t;
    65 extern "C" {
    66         void __cfaabi_dbg_record_lock(struct __spinlock_t & this, const char prev_name[]) __attribute__(( weak )) libcfa_public {}
    67 }
    6865
    6966// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.