Skip to content

Commit 6eda820

Browse files
committed
Add mutex documentation to IrContainer::clear() for Phase 3 safety
1 parent bf4c496 commit 6eda820

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
@@ -75,6 +75,10 @@ IrContainer::~IrContainer() {
7575
clear();
7676
}
7777

78+
// Note: clear() does not acquire mutex_. It is only called from the
79+
// destructor and Fusion::copy(), both of which guarantee exclusive access.
80+
// This assumption must be revisited in Phase 3 when containers may be shared
81+
// across threads.
7882
void IrContainer::clear() noexcept {
7983
FUSER_PERF_SCOPE("IrContainer clear");
8084
vals_.clear();

0 commit comments

Comments
 (0)