- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel/startup.cfa
r3e2b9c9 r1eb239e4 87 87 //----------------------------------------------------------------------------- 88 88 // Other Forward Declarations 89 extern bool__wake_proc(processor *);89 extern void __wake_proc(processor *); 90 90 91 91 //----------------------------------------------------------------------------- … … 475 475 #endif 476 476 477 int target = __atomic_add_fetch( &cltr->nprocessors, 1u, __ATOMIC_SEQ_CST ); 477 lock( this.cltr->idles ); 478 int target = this.cltr->idles.total += 1u; 479 unlock( this.cltr->idles ); 478 480 479 481 id = doregister((__processor_id_t*)&this); … … 493 495 // Not a ctor, it just preps the destruction but should not destroy members 494 496 static void deinit(processor & this) { 495 496 int target = __atomic_sub_fetch( &this.cltr->nprocessors, 1u, __ATOMIC_SEQ_CST ); 497 lock( this.cltr->idles ); 498 int target = this.cltr->idles.total -= 1u; 499 unlock( this.cltr->idles ); 497 500 498 501 // Lock the RWlock so no-one pushes/pops while we are changing the queue … … 501 504 // Adjust the ready queue size 502 505 ready_queue_shrink( this.cltr, target ); 503 504 // Make sure we aren't on the idle queue505 unsafe_remove( this.cltr->idles, &this );506 506 507 507 // Unlock the RWlock … … 545 545 //----------------------------------------------------------------------------- 546 546 // Cluster 547 static void ?{}(__cluster_idles & this) { 548 this.lock = 0; 549 this.idle = 0; 550 this.total = 0; 551 (this.list){}; 552 } 553 547 554 void ?{}(cluster & this, const char name[], Duration preemption_rate, unsigned num_io, const io_context_params & io_params) with( this ) { 548 555 this.name = name; 549 556 this.preemption_rate = preemption_rate; 550 this.nprocessors = 0;551 557 ready_queue{}; 552 558
Note: See TracChangeset
for help on using the changeset viewer.