Changeset 34c6c767 for src/libcfa/concurrency/monitor.c
- Timestamp:
- Nov 9, 2017, 2:01:44 PM (7 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:
- 65d6de4, 6d2386e
- Parents:
- ea7d2b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/monitor.c
rea7d2b0 r34c6c767 54 54 static inline __lock_size_t aggregate ( monitor_desc * storage [], const __waitfor_mask_t & mask ); 55 55 56 #ifndef __CFA_LOCK_NO_YIELD 57 #define DO_LOCK lock_yield 58 #else 59 #define DO_LOCK lock 60 #endif 61 56 62 //----------------------------------------------------------------------------- 57 63 // Useful defines … … 84 90 // Enter single monitor 85 91 static void __enter_monitor_desc( monitor_desc * this, const __monitor_group_t & group ) { 86 // Lock the monitor spinlock , lock_yield to reduce contention87 lock_yield( this->lock DEBUG_CTX2 );92 // Lock the monitor spinlock 93 DO_LOCK( this->lock DEBUG_CTX2 ); 88 94 thread_desc * thrd = this_thread; 89 95 … … 132 138 133 139 static void __enter_monitor_dtor( monitor_desc * this, fptr_t func ) { 134 // Lock the monitor spinlock , lock_yield to reduce contention135 lock_yield( this->lock DEBUG_CTX2 );140 // Lock the monitor spinlock 141 DO_LOCK( this->lock DEBUG_CTX2 ); 136 142 thread_desc * thrd = this_thread; 137 143 … … 196 202 // Leave single monitor 197 203 void __leave_monitor_desc( monitor_desc * this ) { 198 // Lock the monitor spinlock, lock_yieldto reduce contention199 lock_yield( this->lock DEBUG_CTX2 );204 // Lock the monitor spinlock, DO_LOCK to reduce contention 205 DO_LOCK( this->lock DEBUG_CTX2 ); 200 206 201 207 LIB_DEBUG_PRINT_SAFE("Kernel : %10p Leaving mon %p (%p)\n", this_thread, this, this->owner); … … 243 249 244 250 // Lock the monitor now 245 lock_yield( this->lock DEBUG_CTX2 );251 DO_LOCK( this->lock DEBUG_CTX2 ); 246 252 247 253 disable_interrupts(); … … 732 738 static inline void lock_all( __spinlock_t * locks [], __lock_size_t count ) { 733 739 for( __lock_size_t i = 0; i < count; i++ ) { 734 lock_yield( *locks[i] DEBUG_CTX2 );740 DO_LOCK( *locks[i] DEBUG_CTX2 ); 735 741 } 736 742 } … … 739 745 for( __lock_size_t i = 0; i < count; i++ ) { 740 746 __spinlock_t * l = &source[i]->lock; 741 lock_yield( *l DEBUG_CTX2 );747 DO_LOCK( *l DEBUG_CTX2 ); 742 748 if(locks) locks[i] = l; 743 749 }
Note: See TracChangeset
for help on using the changeset viewer.