Changeset dbe9b08 for src/libcfa/bits/locks.h
- Timestamp:
- Jan 25, 2018, 5:02:09 PM (6 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:
- 91496f3
- Parents:
- 6e0f4bd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/bits/locks.h
r6e0f4bd rdbe9b08 58 58 59 59 #ifdef __cforall 60 extern "C" { 61 extern void disable_interrupts(); 62 extern void enable_interrupts_noPoll(); 63 } 64 60 65 extern void yield( unsigned int ); 61 66 extern thread_local struct thread_desc * volatile this_thread; … … 68 73 static inline _Bool try_lock ( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) { 69 74 _Bool result = __lock_test_and_test_and_set( this.lock ); 70 __cfaabi_dbg_debug_do( 71 if( result ) { 75 if( result ) { 76 disable_interrupts(); 77 __cfaabi_dbg_debug_do( 72 78 this.prev_name = caller; 73 79 this.prev_thrd = this_thread; 74 }75 )80 ) 81 } 76 82 return result; 77 83 } … … 99 105 #endif 100 106 } 107 disable_interrupts(); 101 108 __cfaabi_dbg_debug_do( 102 109 this.prev_name = caller; … … 111 118 yield( i ); 112 119 } 120 disable_interrupts(); 113 121 __cfaabi_dbg_debug_do( 114 122 this.prev_name = caller; … … 119 127 static inline void unlock( __spinlock_t & this ) { 120 128 __lock_release( this.lock ); 129 enable_interrupts_noPoll(); 121 130 } 122 131 #endif
Note: See TracChangeset
for help on using the changeset viewer.