Ignore:
Timestamp:
Mar 1, 2026, 5:47:54 PM (37 hours ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
02e7483
Parents:
8086004
Message:

add routines stack_verify and stack_pointer, in debug mode call stack_verify on front-side of context switch and time-slicing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/coroutine.hfa

    r8086004 r0957f62  
    1010// Created On       : Mon Nov 28 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr 25 06:52:04 2025
    13 // Update Count     : 15
     12// Last Modified On : Sun Mar  1 17:44:11 2026
     13// Update Count     : 43
    1414//
    1515
     
    9898}
    9999
     100void stack_verify( coroutine$ * cor );
     101void stack_verify();
     102
    100103// Private wrappers for context switch and stack creation
    101 // Wrapper for co
    102104static inline void $ctx_switch( coroutine$ * src, coroutine$ * dst ) __attribute__((nonnull (1, 2))) {
    103105        // set state of current coroutine to inactive
     
    110112        /* paranoid */ verify( !athrd->corctx_flag );
    111113        athrd->corctx_flag = true;
     114
     115        #if defined( __CFA_DEBUG__ )
     116        stack_verify( src );                                                            // test on front side of context switch, backside is too late.
     117        #endif // __CFA_DEBUG__
    112118
    113119        // set new coroutine that task is executing
     
    225231
    226232// non local ehm and coroutine utility routines
     233void * stack_pointer( coroutine$ * cor );
     234void * stack_pointer();
    227235void enable_ehm();
    228236void disable_ehm();
     
    234242
    235243forall(T & | is_coroutine(T)) {
     244        void * stack_pointer( T & cor );
     245        void stack_verify( T & cor );
    236246    void enable_ehm( T & cor );         // enable checking non-local exceptions for cor via checked_poll
    237247    void disable_ehm( T & cor );        // disable checking non-local exceptions for cor via checked_poll
Note: See TracChangeset for help on using the changeset viewer.