Ignore:
Timestamp:
Nov 13, 2020, 11:32:15 AM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
ac12f1f
Parents:
0989e79
Message:

Alarm loop now has it's own stats block

File:
1 edited

Legend:

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

    r0989e79 r1b033b8  
    393393// reserved for future use
    394394static void timeout( $thread * this ) {
    395         #if !defined( __CFA_NO_STATISTICS__ )
    396                 kernelTLS().this_stats = this->curr_cluster->stats;
    397         #endif
    398395        unpark( this );
    399396}
     
    610607}
    611608
     609#if !defined(__CFA_NO_STATISTICS__)
     610        int __print_alarm_stats = 0;
     611#endif
     612
    612613// Main of the alarm thread
    613614// Waits on SIGALRM and send SIGUSR1 to whom ever needs it
     
    617618        id.id = doregister(&id);
    618619        __cfaabi_tls.this_proc_id = &id;
     620
     621        #if !defined(__CFA_NO_STATISTICS__)
     622                struct __stats_t local_stats;
     623                __cfaabi_tls.this_stats = &local_stats;
     624                __init_stats( &local_stats );
     625        #endif
    619626
    620627        // Block sigalrms to control when they arrive
     
    676683        __cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n" );
    677684        unregister(&id);
     685
     686        #if !defined(__CFA_NO_STATISTICS__)
     687                if( 0 != __print_alarm_stats ) {
     688                        __print_stats( &local_stats, __print_alarm_stats, "Alarm", "Thread", 0p );
     689                }
     690        #endif
    678691        return 0p;
    679692}
Note: See TracChangeset for help on using the changeset viewer.