Ignore:
Timestamp:
Apr 15, 2021, 11:45:44 AM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
a4b0aa4
Parents:
fc59b580
Message:

Ready-queue grow/shrink now reassigns the id of all processors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/startup.cfa

    rfc59b580 ra017ee7  
    469469        this.name = name;
    470470        this.cltr = &_cltr;
     471        this.cltr_id = -1u;
    471472        do_terminate = false;
    472473        preemption_alarm = 0p;
     
    491492        // Register and Lock the RWlock so no-one pushes/pops while we are changing the queue
    492493        uint_fast32_t last_size = ready_mutate_register((__processor_id_t*)&this);
    493                 int target = this.cltr->procs.total += 1u;
     494                this.cltr->procs.total += 1u;
    494495                insert_last(this.cltr->procs.actives, this);
    495496
    496497                // Adjust the ready queue size
    497                 this.cltr_id = ready_queue_grow( cltr, target );
     498                ready_queue_grow( cltr );
    498499
    499500        // Unlock the RWlock
     
    507508        // Lock the RWlock so no-one pushes/pops while we are changing the queue
    508509        uint_fast32_t last_size = ready_mutate_lock();
    509                 int target = this.cltr->procs.total -= 1u;
     510                this.cltr->procs.total -= 1u;
    510511                remove(this);
    511512
    512513                // Adjust the ready queue size
    513                 ready_queue_shrink( this.cltr, target );
     514                ready_queue_shrink( this.cltr );
    514515
    515516        // Unlock the RWlock and unregister: we don't need the read_lock any more
     
    586587
    587588                // Adjust the ready queue size
    588                 ready_queue_grow( &this, 0 );
     589                ready_queue_grow( &this );
    589590
    590591        // Unlock the RWlock
     
    601602
    602603                // Adjust the ready queue size
    603                 ready_queue_shrink( &this, 0 );
     604                ready_queue_shrink( &this );
    604605
    605606        // Unlock the RWlock
Note: See TracChangeset for help on using the changeset viewer.