Ignore:
File:
1 edited

Legend:

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

    r3e2b9c9 r1eb239e4  
    8787//-----------------------------------------------------------------------------
    8888// Other Forward Declarations
    89 extern bool __wake_proc(processor *);
     89extern void __wake_proc(processor *);
    9090
    9191//-----------------------------------------------------------------------------
     
    475475        #endif
    476476
    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 );
    478480
    479481        id = doregister((__processor_id_t*)&this);
     
    493495// Not a ctor, it just preps the destruction but should not destroy members
    494496static 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 );
    497500
    498501        // Lock the RWlock so no-one pushes/pops while we are changing the queue
     
    501504                // Adjust the ready queue size
    502505                ready_queue_shrink( this.cltr, target );
    503 
    504                 // Make sure we aren't on the idle queue
    505                 unsafe_remove( this.cltr->idles, &this );
    506506
    507507        // Unlock the RWlock
     
    545545//-----------------------------------------------------------------------------
    546546// Cluster
     547static void ?{}(__cluster_idles & this) {
     548        this.lock  = 0;
     549        this.idle  = 0;
     550        this.total = 0;
     551        (this.list){};
     552}
     553
    547554void ?{}(cluster & this, const char name[], Duration preemption_rate, unsigned num_io, const io_context_params & io_params) with( this ) {
    548555        this.name = name;
    549556        this.preemption_rate = preemption_rate;
    550         this.nprocessors = 0;
    551557        ready_queue{};
    552558
Note: See TracChangeset for help on using the changeset viewer.