Ignore:
Timestamp:
Feb 7, 2026, 1:40:26 PM (39 hours ago)
Author:
Matthew Au-Yeung <mw2auyeu@…>
Branches:
stuck-waitfor-destruct
Parents:
c7d106a
git-author:
Matthew Au-Yeung <mw2auyeu@…> (02/07/26 13:40:05)
git-committer:
Matthew Au-Yeung <mw2auyeu@…> (02/07/26 13:40:26)
Message:

Add a generated hash to fix stuck waitfor comparing static inline mutex destructors

File:
1 edited

Legend:

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

    rc7d106a ra9ce782  
    140140}
    141141
    142 static void __dtor_enter( monitor$ * this, fptr_t func, bool join ) {
     142static void __dtor_enter( monitor$ * this, fptr_t func, func_id_t func_id, bool join ) {
    143143        thread$ * thrd = active_thread();
    144144        #if defined( __CFA_WITH_VERIFY__ )
     
    190190        __lock_size_t count = 1;
    191191        monitor$ ** monitors = &this;
    192         __monitor_group_t group = { &this, 1, func };
     192        __monitor_group_t group = { &this, 1, func, func_id };
    193193        if ( is_accepted( this, group) ) {
    194194                __cfaabi_dbg_print_safe( "Kernel : mon accepts dtor, block and signal it \n" );
     
    341341// Ctor for monitor guard
    342342// Sorts monitors before entering
    343 void ?{}( monitor_guard_t & this, monitor$ * m [], __lock_size_t count, fptr_t func ) libcfa_public {
     343void ?{}( monitor_guard_t & this, monitor$ * m [], __lock_size_t count, fptr_t func, func_id_t func_id ) libcfa_public {
    344344        thread$ * thrd = active_thread();
    345345
     
    355355
    356356        // Update thread context (needed for conditions)
    357         (thrd->monitors){m, count, func};
     357        (thrd->monitors){m, count, func, func_id};
    358358
    359359        // __cfaabi_dbg_print_safe( "MGUARD : enter %d\n", count);
    360360
    361361        // Enter the monitors in order
    362         __monitor_group_t group = {this.m, this.count, func};
     362        __monitor_group_t group = {this.m, this.count, func, func_id};
    363363        enter( group );
    364364
     
    367367
    368368void ?{}( monitor_guard_t & this, monitor$ * m [], __lock_size_t count ) libcfa_public {
    369         this{ m, count, 0p };
     369        this{ m, count, 0p, 0 };
    370370}
    371371
     
    386386// Ctor for monitor guard
    387387// Sorts monitors before entering
    388 void ?{}( monitor_dtor_guard_t & this, monitor$ * m [], fptr_t func, bool join ) libcfa_public {
     388void ?{}( monitor_dtor_guard_t & this, monitor$ * m [], fptr_t func, func_id_t func_id, bool join ) libcfa_public {
    389389        // optimization
    390390        thread$ * thrd = active_thread();
     
    400400
    401401        // Update thread context (needed for conditions)
    402         (thrd->monitors){m, 1, func};
    403 
    404         __dtor_enter( this.m, func, join );
     402        (thrd->monitors){m, 1, func, func_id};
     403
     404        __dtor_enter( this.m, func, func_id, join );
    405405}
    406406
Note: See TracChangeset for help on using the changeset viewer.