Skip to content

Commit

Permalink
fix thread-safety issue for logging singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
samansmink committed Jan 13, 2025
1 parent 89ebdb7 commit 0ece666
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/delta_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,9 @@ uintptr_t PredicateVisitor::VisitFilter(const string &col_name, const TableFilte
void LoggerCallback::Initialize(DatabaseInstance &db_p) {
auto &instance = GetInstance();
unique_lock<mutex> lck(instance.lock);
instance.db = db_p.shared_from_this();
if (instance.db.expired()) {
instance.db = db_p.shared_from_this();
}
}

void LoggerCallback::CallbackEvent(ffi::Event event) {
Expand Down

0 comments on commit 0ece666

Please sign in to comment.