Ignore:
Timestamp:
Feb 8, 2018, 4:52:09 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
06b176d
Parents:
3f8ab8f
Message:

update abort, remove abortf, add printing exit

File:
1 edited

Legend:

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

    r3f8ab8f r169d944  
    1010// Created On       : Mon Jun 5 14:20:42 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  6 15:00:36 2018
    13 // Update Count     : 10
     12// Last Modified On : Thu Feb  8 16:12:58 2018
     13// Update Count     : 12
    1414//
    1515
     
    192192
    193193        if ( pthread_sigmask( SIG_UNBLOCK, &mask, NULL ) == -1 ) {
    194             abortf( "internal error, pthread_sigmask" );
     194            abort( "internal error, pthread_sigmask" );
    195195        }
    196196}
     
    203203
    204204        if ( pthread_sigmask( SIG_BLOCK, &mask, NULL ) == -1 ) {
    205             abortf( "internal error, pthread_sigmask" );
     205            abort( "internal error, pthread_sigmask" );
    206206        }
    207207}
     
    234234// Called from kernel_startup
    235235void kernel_start_preemption() {
    236         __cfaabi_dbg_print_safe("Kernel : Starting preemption\n");
     236        __cfaabi_dbg_print_safe( "Kernel : Starting preemption\n" );
    237237
    238238        // Start with preemption disabled until ready
     
    255255// Called from kernel_shutdown
    256256void kernel_stop_preemption() {
    257         __cfaabi_dbg_print_safe("Kernel : Preemption stopping\n");
     257        __cfaabi_dbg_print_safe( "Kernel : Preemption stopping\n" );
    258258
    259259        // Block all signals since we are already shutting down
     
    271271        // Preemption is now fully stopped
    272272
    273         __cfaabi_dbg_print_safe("Kernel : Preemption stopped\n");
     273        __cfaabi_dbg_print_safe( "Kernel : Preemption stopped\n" );
    274274}
    275275
     
    302302        if( !preemption_ready() ) { return; }
    303303
    304         __cfaabi_dbg_print_buffer_decl(" KERNEL: preempting core %p (%p).\n", this_processor, this_thread);
     304        __cfaabi_dbg_print_buffer_decl( " KERNEL: preempting core %p (%p).\n", this_processor, this_thread);
    305305
    306306        preemption_in_progress = true;                      // Sync flag : prevent recursive calls to the signal handler
     
    322322
    323323        if ( pthread_sigmask( SIG_BLOCK, &mask, NULL ) == -1 ) {
    324             abortf( "internal error, pthread_sigmask" );
     324            abort( "internal error, pthread_sigmask" );
    325325        }
    326326
     
    339339                                        continue;
    340340                        case EINVAL :
    341                                         abortf("Timeout was invalid.");
     341                                        abort( "Timeout was invalid." );
    342342                                default:
    343                                         abortf("Unhandled error %d", err);
     343                                        abort( "Unhandled error %d", err);
    344344                        }
    345345                }
     
    348348                assertf(sig == SIGALRM, "Kernel Internal Error, sigwait: Unexpected signal %d (%d : %d)\n", sig, info.si_code, info.si_value.sival_int);
    349349
    350                 // __cfaabi_dbg_print_safe("Kernel : Caught alarm from %d with %d\n", info.si_code, info.si_value.sival_int );
     350                // __cfaabi_dbg_print_safe( "Kernel : Caught alarm from %d with %d\n", info.si_code, info.si_value.sival_int );
    351351                // Switch on the code (a.k.a. the sender) to
    352352                switch( info.si_code )
     
    356356                case SI_TIMER:
    357357                case SI_KERNEL:
    358                         // __cfaabi_dbg_print_safe("Kernel : Preemption thread tick\n");
     358                        // __cfaabi_dbg_print_safe( "Kernel : Preemption thread tick\n" );
    359359                        lock( event_kernel->lock __cfaabi_dbg_ctx2 );
    360360                        tick_preemption();
     
    370370
    371371EXIT:
    372         __cfaabi_dbg_print_safe("Kernel : Preemption thread stopping\n");
     372        __cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n" );
    373373        return NULL;
    374374}
Note: See TracChangeset for help on using the changeset viewer.