Ignore:
File:
1 edited

Legend:

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

    rbecb85b9 r941e14a  
    251251        bool enabled = __cfaabi_tls.preemption_state.enabled;
    252252
    253         // Check if there is a pending preemption
    254         processor   * proc = __cfaabi_tls.this_processor;
    255         bool pending = proc ? proc->pending_preemption : false;
    256         if( enabled && pending ) proc->pending_preemption = false;
    257 
    258253        // create a assembler label after
    259254        // marked as clobber all to avoid movement
    260255        __cfaasm_label(check, after);
    261 
    262         // If we can preempt and there is a pending one
    263         // this is a good time to yield
    264         if( enabled && pending ) {
    265                 force_yield( __POLL_PREEMPTION );
    266         }
    267256        return enabled;
    268257}
     
    293282        // marked as clobber all to avoid movement
    294283        __cfaasm_label(get, after);
    295 
    296         // This is used everywhere, to avoid cost, we DO NOT poll pending preemption
    297284        return val;
    298285}
     
    371358        if(!ready) { abort("Preemption should be ready"); }
    372359
    373         // __cfaasm_label(debug, before);
     360        __cfaasm_label(debug, before);
    374361
    375362                sigset_t oldset;
     
    390377                if(ret == 1) { abort("ERROR SIGTERM is disabled"); }
    391378
    392         // __cfaasm_label(debug, after);
     379        __cfaasm_label(debug, after);
    393380}
    394381
     
    561548        __cfaasm_label( check  );
    562549        __cfaasm_label( dsable );
    563         // __cfaasm_label( debug  );
     550        __cfaasm_label( debug  );
    564551
    565552        // Check if preemption is safe
     
    568555        if( __cfaasm_in( ip, check  ) ) { ready = false; goto EXIT; };
    569556        if( __cfaasm_in( ip, dsable ) ) { ready = false; goto EXIT; };
    570         // if( __cfaasm_in( ip, debug  ) ) { ready = false; goto EXIT; };
     557        if( __cfaasm_in( ip, debug  ) ) { ready = false; goto EXIT; };
    571558        if( !__cfaabi_tls.preemption_state.enabled) { ready = false; goto EXIT; };
    572559        if( __cfaabi_tls.preemption_state.in_progress ) { ready = false; goto EXIT; };
Note: See TracChangeset for help on using the changeset viewer.