Skip to content

Commit 5d12b11

Browse files
committed
Add mutex documentation to IrContainer::clear() for Phase 3 safety
1 parent c3007ee commit 5d12b11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

csrc/ir/container.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ IrContainer::~IrContainer() {
7070
clear();
7171
}
7272

73+
// Note: clear() does not acquire mutex_. It is only called from the
74+
// destructor and Fusion::copy(), both of which guarantee exclusive access.
75+
// This assumption must be revisited in Phase 3 when containers may be shared
76+
// across threads.
7377
void IrContainer::clear() noexcept {
7478
FUSER_PERF_SCOPE("IrContainer clear");
7579
vals_.clear();

0 commit comments

Comments
 (0)