Ignore:
Timestamp:
Feb 7, 2026, 1:40:26 PM (21 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/Validate/Autogen.cpp

    rc7d106a ra9ce782  
    402402        }
    403403
    404         ast::FunctionDecl * decl = genProto( "^?{}", { dst }, {} );
    405         // For concurrent types, remove static storage and inline specifier, and add
    406         // cfa_linkonce attribute so the destructor has external linkage with linkonce
    407         // semantics. This is required for waitfor to work correctly across translation
    408         // units - the function pointer must be the same everywhere, and cfa_linkonce
    409         // ensures only one definition survives linking.
    410         if ( isConcurrentType() ) {
    411                 auto mut = ast::mutate( decl );
    412                 mut->storage = ast::Storage::Classes();
    413                 mut->funcSpec = ast::Function::Specs();
    414                 mut->attributes.push_back( new ast::Attribute( "cfa_linkonce" ) );
    415         }
    416         return decl;
     404        return genProto( "^?{}", { dst }, {} );
    417405}
    418406
Note: See TracChangeset for help on using the changeset viewer.