- Timestamp:
- Mar 30, 2023, 4:27:13 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- c7f6786
- Parents:
- 9082d7e8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/concurrency/locks.hfa ¶
r9082d7e8 rbd72c28 243 243 } 244 244 245 const int __go_mtx_spins = 4;246 const int __go_mtx_pauses = 30;247 245 // if this is called recursively IT WILL DEADLOCK!!!!! 248 246 static inline void lock(go_mutex & this) with(this) { … … 254 252 init_state = state; 255 253 for (;;) { 256 for( int i = 0; i < __go_mtx_spins; i++ ) {254 for( int i = 0; i < 4; i++ ) { 257 255 while( !val ) { // lock unlocked 258 256 state = 0; 259 257 if (internal_try_lock(this, state, init_state)) return; 260 258 } 261 for (int i = 0; i < __go_mtx_pauses; i++) Pause();259 for (int i = 0; i < 30; i++) Pause(); 262 260 } 263 261
Note: See TracChangeset
for help on using the changeset viewer.