Skip to content

Commit

Permalink
add comment regarding usage model for flush_objects() to relate with pr
Browse files Browse the repository at this point in the history
#6992

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Nov 15, 2023
1 parent 3baaba5 commit f1a39b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/api_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ namespace api {
m().dec_ref(a);
}

// flush_objects can only be called in the main thread.
// This ensures that the calls to m().dec_ref() and dealloc(o)
// only happens in the main thread.
// Calls to dec_ref are allowed in other threads when m_concurrent_dec_ref is
// set to true.
void context::flush_objects() {
#ifndef SINGLE_THREAD
if (!m_concurrent_dec_ref)
Expand Down

0 comments on commit f1a39b8

Please sign in to comment.