Changeset 320ec6fc for libcfa/src/concurrency/kernel.cfa
- Timestamp:
- Jul 24, 2020, 1:11:39 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 39fc03e
- Parents:
- f4ec4a90
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
rf4ec4a90 r320ec6fc 242 242 #endif 243 243 244 __atomic_fetch_add( &cltr->nprocessors, 1u, __ATOMIC_SEQ_CST );244 int target = __atomic_add_fetch( &cltr->nprocessors, 1u, __ATOMIC_SEQ_CST ); 245 245 246 246 id = doregister((__processor_id_t*)&this); … … 250 250 251 251 // Adjust the ready queue size 252 ready_queue_grow( cltr );252 ready_queue_grow( cltr, target ); 253 253 254 254 // Unlock the RWlock … … 260 260 // Not a ctor, it just preps the destruction but should not destroy members 261 261 void deinit(processor & this) { 262 263 int target = __atomic_sub_fetch( &this.cltr->nprocessors, 1u, __ATOMIC_SEQ_CST ); 264 262 265 // Lock the RWlock so no-one pushes/pops while we are changing the queue 263 266 uint_fast32_t last_size = ready_mutate_lock(); 264 267 265 268 // Adjust the ready queue size 266 ready_queue_shrink( this.cltr );269 ready_queue_shrink( this.cltr, target ); 267 270 268 271 // Make sure we aren't on the idle queue … … 305 308 306 309 deinit( this ); 307 308 __atomic_fetch_sub( &cltr->nprocessors, 1u, __ATOMIC_SEQ_CST );309 310 } 310 311 … … 936 937 937 938 /* paranoid */ verify( this.do_terminate == true ); 938 __atomic_fetch_sub( &cltr->nprocessors, 1u, __ATOMIC_SEQ_CST );939 939 __cfaabi_dbg_print_safe("Kernel : destroyed main processor context %p\n", &runner); 940 940 }
Note: See TracChangeset
for help on using the changeset viewer.