Index: libcfa/src/bits/locks.hfa
===================================================================
--- libcfa/src/bits/locks.hfa	(revision e84ab3dadc96fd4dc82b5b0bc20cfe9b14f64259)
+++ libcfa/src/bits/locks.hfa	(revision 5b7a366285c53991ffc13bb9142a7410cd0b7f56)
@@ -31,4 +31,6 @@
 		// previous thread to acquire the lock
 		void* prev_thrd;
+		// keep track of number of times we had to spin, just in case the number is unexpectedly huge
+		size_t spin_count;
 	#endif
 };
@@ -48,4 +50,7 @@
 	static inline void ?{}( __spinlock_t & this ) {
 		this.lock = 0;
+		#ifdef __CFA_DEBUG__
+			this.spin_count = 0;
+		#endif
 	}
 
@@ -72,4 +77,7 @@
 		for ( unsigned int i = 1;; i += 1 ) {
 			if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break;
+			#ifdef __CFA_DEBUG__
+				this.spin_count++;
+			#endif
 			#ifndef NOEXPBACK
 				// exponential spin
