- Timestamp:
- Feb 25, 2026, 12:56:30 AM (4 days ago)
- Branches:
- stuck-waitfor-destruct
- Children:
- 88bb0b4
- Parents:
- a0548c2
- Location:
- src
- Files:
-
- 1 deleted
- 3 edited
-
Concurrency/Keywords.cpp (modified) (7 diffs)
-
Concurrency/MutexFuncHash.hpp (deleted)
-
Concurrency/Waitfor.cpp (modified) (2 diffs)
-
Validate/Autogen.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cpp
ra0548c2 r44940ee 29 29 #include "Common/Examine.hpp" 30 30 #include "Common/Utility.hpp" 31 #include "Concurrency/MutexFuncHash.hpp"32 31 #include "Common/UniqueName.hpp" 33 32 #include "ControlStruct/LabelGenerator.hpp" … … 1078 1077 1079 1078 // In reverse order: 1080 // monitor_dtor_guard_t __guard = { __monitor, func, f unc_id, false };1079 // monitor_dtor_guard_t __guard = { __monitor, func, false }; 1081 1080 mutBody->push_front( 1082 1081 new ast::DeclStmt( location, new ast::ObjectDecl( … … 1095 1094 generic_func, 1096 1095 ast::ExplicitCast ) ), 1097 new ast::SingleInit( location,1098 Concurrency::hashMangleExpr( location, func ) ),1099 1096 new ast::SingleInit( location, 1100 1097 ast::ConstantExpr::from_bool( location, false ) ), … … 1178 1175 ast::ExplicitCast 1179 1176 ) ), 1180 new ast::SingleInit( location,1181 Concurrency::hashMangleExpr( location, func ) ),1182 1177 }, 1183 1178 {}, … … 1480 1475 1481 1476 ast::CompoundStmt * MutexKeyword::addThreadDtorStatements( 1482 const ast::FunctionDecl* func, const ast::CompoundStmt * body,1477 const ast::FunctionDecl*, const ast::CompoundStmt * body, 1483 1478 const std::vector<const ast::DeclWithType * > & args ) { 1484 1479 assert( args.size() == 1 ); … … 1492 1487 const CodeLocation & location = mutBody->location; 1493 1488 1494 // thread_dtor_guard_t __guard = { this, func_id,intptr( 0 ) };1489 // thread_dtor_guard_t __guard = { this, intptr( 0 ) }; 1495 1490 mutBody->push_front( new ast::DeclStmt( 1496 1491 location, … … 1505 1500 new ast::CastExpr( location, 1506 1501 new ast::VariableExpr( location, arg ), argType ) ), 1507 new ast::SingleInit( location,1508 Concurrency::hashMangleExpr( location, func ) ),1509 1502 new ast::SingleInit( 1510 1503 location, -
src/Concurrency/Waitfor.cpp
ra0548c2 r44940ee 22 22 #include "InitTweak/InitTweak.hpp" 23 23 #include "ResolvExpr/Resolver.hpp" 24 #include "Concurrency/MutexFuncHash.hpp"25 24 26 25 #include "AST/Print.hpp" … … 332 331 makeAccStmt( location, acceptables, index, "func", 333 332 funcExpr, context ), 334 makeAccStmt( location, acceptables, index, "func_id",335 Concurrency::hashMangleExpr( location,336 variableExpr->var.strict_as<ast::DeclWithType>() ),337 context ),338 333 makeAccStmt( location, acceptables, index, "data", 339 334 new ast::VariableExpr( location, monitors ), context ), -
src/Validate/Autogen.cpp
ra0548c2 r44940ee 402 402 } 403 403 404 return genProto( "^?{}", { dst }, {} ); 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; 405 417 } 406 418
Note:
See TracChangeset
for help on using the changeset viewer.