- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel/startup.cfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel/startup.cfa
ra017ee7 r73f4d08 469 469 this.name = name; 470 470 this.cltr = &_cltr; 471 this.cltr_id = -1u;472 471 do_terminate = false; 473 472 preemption_alarm = 0p; … … 490 489 #endif 491 490 492 // Register and Lock the RWlock so no-one pushes/pops while we are changing the queue 493 uint_fast32_t last_size = ready_mutate_register((__processor_id_t*)&this); 494 this.cltr->procs.total += 1u; 495 insert_last(this.cltr->procs.actives, this); 491 lock( this.cltr->idles ); 492 int target = this.cltr->idles.total += 1u; 493 unlock( this.cltr->idles ); 494 495 id = doregister((__processor_id_t*)&this); 496 497 // Lock the RWlock so no-one pushes/pops while we are changing the queue 498 uint_fast32_t last_size = ready_mutate_lock(); 496 499 497 500 // Adjust the ready queue size 498 ready_queue_grow( cltr);501 this.cltr_id = ready_queue_grow( cltr, target ); 499 502 500 503 // Unlock the RWlock … … 506 509 // Not a ctor, it just preps the destruction but should not destroy members 507 510 static void deinit(processor & this) { 511 lock( this.cltr->idles ); 512 int target = this.cltr->idles.total -= 1u; 513 unlock( this.cltr->idles ); 514 508 515 // Lock the RWlock so no-one pushes/pops while we are changing the queue 509 516 uint_fast32_t last_size = ready_mutate_lock(); 510 this.cltr->procs.total -= 1u;511 remove(this);512 517 513 518 // Adjust the ready queue size 514 ready_queue_shrink( this.cltr ); 515 516 // Unlock the RWlock and unregister: we don't need the read_lock any more 517 ready_mutate_unregister((__processor_id_t*)&this, last_size ); 519 ready_queue_shrink( this.cltr, target ); 520 521 // Unlock the RWlock 522 ready_mutate_unlock( last_size ); 523 524 // Finally we don't need the read_lock any more 525 unregister((__processor_id_t*)&this); 518 526 519 527 close(this.idle); … … 558 566 //----------------------------------------------------------------------------- 559 567 // Cluster 560 static void ?{}(__cluster_ proc_list& this) {568 static void ?{}(__cluster_idles & this) { 561 569 this.lock = 0; 562 570 this.idle = 0; 563 571 this.total = 0; 572 (this.list){}; 564 573 } 565 574 … … 587 596 588 597 // Adjust the ready queue size 589 ready_queue_grow( &this );598 ready_queue_grow( &this, 0 ); 590 599 591 600 // Unlock the RWlock … … 602 611 603 612 // Adjust the ready queue size 604 ready_queue_shrink( &this );613 ready_queue_shrink( &this, 0 ); 605 614 606 615 // Unlock the RWlock
Note:
See TracChangeset
for help on using the changeset viewer.