Ignore:
Timestamp:
Jul 24, 2020, 3:42:32 PM (15 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
7458fea
Parents:
320ec6fc
Message:

Fixed ready_queue working with 0/1 processors on cluster

File:
1 edited

Legend:

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

    r320ec6fc r39fc03e  
    324324        threads{ __get };
    325325
     326        doregister(this);
     327
     328        // Lock the RWlock so no-one pushes/pops while we are changing the queue
     329        uint_fast32_t last_size = ready_mutate_lock();
     330
     331                // Adjust the ready queue size
     332                ready_queue_grow( &this, 0 );
     333
     334        // Unlock the RWlock
     335        ready_mutate_unlock( last_size );
     336
     337
    326338        __kernel_io_startup( this, io_flags, &this == mainCluster );
    327 
    328         doregister(this);
    329339}
    330340
    331341void ^?{}(cluster & this) {
    332342        __kernel_io_shutdown( this, &this == mainCluster );
     343
     344        // Lock the RWlock so no-one pushes/pops while we are changing the queue
     345        uint_fast32_t last_size = ready_mutate_lock();
     346
     347                // Adjust the ready queue size
     348                ready_queue_shrink( &this, 0 );
     349
     350        // Unlock the RWlock
     351        ready_mutate_unlock( last_size );
    333352
    334353        #if !defined(__CFA_NO_STATISTICS__)
Note: See TracChangeset for help on using the changeset viewer.