Index: libcfa/src/bits/locks.hfa
===================================================================
--- libcfa/src/bits/locks.hfa	(revision 078fb05a0bcd4317ce79e783caa7954e7232d3f0)
+++ libcfa/src/bits/locks.hfa	(revision 418d31ac9d62c46c04edf3549bc064ef9ba5e0a3)
@@ -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
