Changeset 58fe85a for libcfa/src/concurrency/mutex.cfa
- Timestamp:
- Jan 7, 2021, 3:27:00 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 2b4daf2, 64aeca0
- Parents:
- 3c64c668 (diff), eef8dfb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/mutex.cfa
r3c64c668 r58fe85a 30 30 this.lock{}; 31 31 this.blocked_threads{}; 32 this.is_locked = false; 32 33 } 33 34 … … 39 40 lock( lock __cfaabi_dbg_ctx2 ); 40 41 if( is_locked ) { 41 append( blocked_threads, kernelTLS.this_thread);42 append( blocked_threads, active_thread() ); 42 43 unlock( lock ); 43 44 park(); … … 85 86 lock( lock __cfaabi_dbg_ctx2 ); 86 87 if( owner == 0p ) { 87 owner = kernelTLS.this_thread;88 owner = active_thread(); 88 89 recursion_count = 1; 89 90 unlock( lock ); 90 91 } 91 else if( owner == kernelTLS.this_thread) {92 else if( owner == active_thread() ) { 92 93 recursion_count++; 93 94 unlock( lock ); 94 95 } 95 96 else { 96 append( blocked_threads, kernelTLS.this_thread);97 append( blocked_threads, active_thread() ); 97 98 unlock( lock ); 98 99 park(); … … 104 105 lock( lock __cfaabi_dbg_ctx2 ); 105 106 if( owner == 0p ) { 106 owner = kernelTLS.this_thread;107 owner = active_thread(); 107 108 recursion_count = 1; 108 109 ret = true; 109 110 } 110 else if( owner == kernelTLS.this_thread) {111 else if( owner == active_thread() ) { 111 112 recursion_count++; 112 113 ret = true; … … 158 159 void wait(condition_variable & this) { 159 160 lock( this.lock __cfaabi_dbg_ctx2 ); 160 append( this.blocked_threads, kernelTLS.this_thread);161 append( this.blocked_threads, active_thread() ); 161 162 unlock( this.lock ); 162 163 park(); … … 166 167 void wait(condition_variable & this, L & l) { 167 168 lock( this.lock __cfaabi_dbg_ctx2 ); 168 append( this.blocked_threads, kernelTLS.this_thread);169 append( this.blocked_threads, active_thread() ); 169 170 unlock(l); 170 171 unlock(this.lock);
Note:
See TracChangeset
for help on using the changeset viewer.