Changeset 804c0ff
- Timestamp:
- Jan 15, 2021, 2:23:08 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8c43d05
- Parents:
- b8b0de0c
- Location:
- libcfa/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
rb8b0de0c r804c0ff 624 624 // Unexpected Terminating logic 625 625 //============================================================================================= 626 static __spinlock_t kernel_abort_lock; 627 static bool kernel_abort_called = false; 626 627 extern "C" { 628 extern void __cfaabi_real_abort(void); 629 } 630 static volatile bool kernel_abort_called = false; 628 631 629 632 void * kernel_abort(void) __attribute__ ((__nothrow__)) { 630 633 // abort cannot be recursively entered by the same or different processors because all signal handlers return when 631 634 // the globalAbort flag is true. 632 lock( kernel_abort_lock __cfaabi_dbg_ctx2 ); 635 bool first = __atomic_test_and_set( &kernel_abort_called, __ATOMIC_SEQ_CST); 636 637 // first task to abort ? 638 if ( !first ) { 639 // We aren't the first to abort. 640 // I give up, just let C handle it 641 __cfaabi_real_abort(); 642 } 633 643 634 644 // disable interrupts, it no longer makes sense to try to interrupt this processor 635 645 disable_interrupts(); 636 637 // first task to abort ?638 if ( kernel_abort_called ) { // not first task to abort ?639 unlock( kernel_abort_lock );640 641 sigset_t mask;642 sigemptyset( &mask );643 sigaddset( &mask, SIGALRM ); // block SIGALRM signals644 sigaddset( &mask, SIGUSR1 ); // block SIGALRM signals645 sigsuspend( &mask ); // block the processor to prevent further damage during abort646 _exit( EXIT_FAILURE ); // if processor unblocks before it is killed, terminate it647 }648 else {649 kernel_abort_called = true;650 unlock( kernel_abort_lock );651 }652 646 653 647 return __cfaabi_tls.this_thread; -
libcfa/src/interpose.cfa
rb8b0de0c r804c0ff 284 284 } 285 285 286 extern "C" { 287 void __cfaabi_real_abort(void) { 288 __cabi_libc.abort(); 289 } 290 } 291 286 292 void sigHandler_segv( __CFA_SIGPARMS__ ) { 287 293 if ( sfp->si_addr == 0p ) {
Note: See TracChangeset
for help on using the changeset viewer.