Ignore:
Timestamp:
Feb 7, 2026, 1:40:26 PM (18 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
  • src/Concurrency/Keywords.cpp

    rc7d106a ra9ce782  
    2929#include "Common/Examine.hpp"
    3030#include "Common/Utility.hpp"
     31#include "Concurrency/MutexFuncHash.hpp"
    3132#include "Common/UniqueName.hpp"
    3233#include "ControlStruct/LabelGenerator.hpp"
     
    10771078
    10781079        // In reverse order:
    1079         // monitor_dtor_guard_t __guard = { __monitor, func, false };
     1080        // monitor_dtor_guard_t __guard = { __monitor, func, func_id, false };
    10801081        mutBody->push_front(
    10811082                new ast::DeclStmt( location, new ast::ObjectDecl(
     
    10941095                                                        generic_func,
    10951096                                                        ast::ExplicitCast ) ),
     1097                                        new ast::SingleInit( location,
     1098                                                Concurrency::hashMangleExpr( location, func ) ),
    10961099                                        new ast::SingleInit( location,
    10971100                                                ast::ConstantExpr::from_bool( location, false ) ),
     
    11751178                                                ast::ExplicitCast
    11761179                                        ) ),
     1180                                        new ast::SingleInit( location,
     1181                                                Concurrency::hashMangleExpr( location, func ) ),
    11771182                                },
    11781183                                {},
     
    14751480
    14761481ast::CompoundStmt * MutexKeyword::addThreadDtorStatements(
    1477                 const ast::FunctionDecl*, const ast::CompoundStmt * body,
     1482                const ast::FunctionDecl* func, const ast::CompoundStmt * body,
    14781483                const std::vector<const ast::DeclWithType * > & args ) {
    14791484        assert( args.size() == 1 );
     
    14871492        const CodeLocation & location = mutBody->location;
    14881493
    1489         // thread_dtor_guard_t __guard = { this, intptr( 0 ) };
     1494        // thread_dtor_guard_t __guard = { this, func_id, intptr( 0 ) };
    14901495        mutBody->push_front( new ast::DeclStmt(
    14911496                location,
     
    15001505                                                new ast::CastExpr( location,
    15011506                                                        new ast::VariableExpr( location, arg ), argType ) ),
     1507                                        new ast::SingleInit( location,
     1508                                                Concurrency::hashMangleExpr( location, func ) ),
    15021509                                        new ast::SingleInit(
    15031510                                                location,
Note: See TracChangeset for help on using the changeset viewer.