- Timestamp:
- Feb 4, 2022, 2:44:10 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 67e86ae6
- Parents:
- 941e14a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/preemption.cfa
r941e14a rbecb85b9 251 251 bool enabled = __cfaabi_tls.preemption_state.enabled; 252 252 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 253 258 // create a assembler label after 254 259 // marked as clobber all to avoid movement 255 260 __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 } 256 267 return enabled; 257 268 } … … 282 293 // marked as clobber all to avoid movement 283 294 __cfaasm_label(get, after); 295 296 // This is used everywhere, to avoid cost, we DO NOT poll pending preemption 284 297 return val; 285 298 } … … 358 371 if(!ready) { abort("Preemption should be ready"); } 359 372 360 __cfaasm_label(debug, before);373 // __cfaasm_label(debug, before); 361 374 362 375 sigset_t oldset; … … 377 390 if(ret == 1) { abort("ERROR SIGTERM is disabled"); } 378 391 379 __cfaasm_label(debug, after);392 // __cfaasm_label(debug, after); 380 393 } 381 394 … … 548 561 __cfaasm_label( check ); 549 562 __cfaasm_label( dsable ); 550 __cfaasm_label( debug );563 // __cfaasm_label( debug ); 551 564 552 565 // Check if preemption is safe … … 555 568 if( __cfaasm_in( ip, check ) ) { ready = false; goto EXIT; }; 556 569 if( __cfaasm_in( ip, dsable ) ) { ready = false; goto EXIT; }; 557 if( __cfaasm_in( ip, debug ) ) { ready = false; goto EXIT; };570 // if( __cfaasm_in( ip, debug ) ) { ready = false; goto EXIT; }; 558 571 if( !__cfaabi_tls.preemption_state.enabled) { ready = false; goto EXIT; }; 559 572 if( __cfaabi_tls.preemption_state.in_progress ) { ready = false; goto EXIT; };
Note: See TracChangeset
for help on using the changeset viewer.