Changeset 2e9aed4 for src/libcfa/bits
- Timestamp:
- Jan 30, 2018, 2:04:27 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ffd0ac2
- Parents:
- 813ddcaa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/bits/locks.h
r813ddcaa r2e9aed4 65 65 extern void yield( unsigned int ); 66 66 extern thread_local struct thread_desc * volatile this_thread; 67 extern thread_local struct processor * volatile this_processor; 67 68 68 69 static inline void ?{}( __spinlock_t & this ) { … … 112 113 } 113 114 114 // Lock the spinlock, spinif already acquired115 static inline void lock_yield( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {116 for ( unsigned int i = 1;; i += 1 ) {117 if ( __lock_test_and_test_and_set( this.lock ) ) break;118 yield( i );119 }120 disable_interrupts();121 __cfaabi_dbg_debug_do(122 this.prev_name = caller;123 this.prev_thrd = this_thread;124 )125 }115 // // Lock the spinlock, yield if already acquired 116 // static inline void lock_yield( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) { 117 // for ( unsigned int i = 1;; i += 1 ) { 118 // if ( __lock_test_and_test_and_set( this.lock ) ) break; 119 // yield( i ); 120 // } 121 // disable_interrupts(); 122 // __cfaabi_dbg_debug_do( 123 // this.prev_name = caller; 124 // this.prev_thrd = this_thread; 125 // ) 126 // } 126 127 127 128 static inline void unlock( __spinlock_t & this ) { 129 enable_interrupts_noPoll(); 128 130 __lock_release( this.lock ); 129 enable_interrupts_noPoll();130 131 } 131 132 #endif
Note:
See TracChangeset
for help on using the changeset viewer.