Changes in / [67e86ae6:c14d91a]
- File:
-
- 1 edited
-
libcfa/src/concurrency/preemption.cfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/preemption.cfa
r67e86ae6 rc14d91a 251 251 bool enabled = __cfaabi_tls.preemption_state.enabled; 252 252 253 // Check if there is a pending preemption254 processor * proc = __cfaabi_tls.this_processor;255 bool pending = proc ? proc->pending_preemption : false;256 if( enabled && pending ) proc->pending_preemption = false;257 258 253 // create a assembler label after 259 254 // marked as clobber all to avoid movement 260 255 __cfaasm_label(check, after); 261 262 // If we can preempt and there is a pending one263 // this is a good time to yield264 if( enabled && pending ) {265 force_yield( __POLL_PREEMPTION );266 }267 256 return enabled; 268 257 } … … 293 282 // marked as clobber all to avoid movement 294 283 __cfaasm_label(get, after); 295 296 // This is used everywhere, to avoid cost, we DO NOT poll pending preemption297 284 return val; 298 285 } … … 371 358 if(!ready) { abort("Preemption should be ready"); } 372 359 373 //__cfaasm_label(debug, before);360 __cfaasm_label(debug, before); 374 361 375 362 sigset_t oldset; … … 390 377 if(ret == 1) { abort("ERROR SIGTERM is disabled"); } 391 378 392 //__cfaasm_label(debug, after);379 __cfaasm_label(debug, after); 393 380 } 394 381 … … 561 548 __cfaasm_label( check ); 562 549 __cfaasm_label( dsable ); 563 //__cfaasm_label( debug );550 __cfaasm_label( debug ); 564 551 565 552 // Check if preemption is safe … … 568 555 if( __cfaasm_in( ip, check ) ) { ready = false; goto EXIT; }; 569 556 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; }; 571 558 if( !__cfaabi_tls.preemption_state.enabled) { ready = false; goto EXIT; }; 572 559 if( __cfaabi_tls.preemption_state.in_progress ) { ready = false; goto EXIT; };
Note:
See TracChangeset
for help on using the changeset viewer.