Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide thread-safe set #3100

Merged
merged 16 commits into from
Jan 26, 2025
Prev Previous commit
Next Next commit
Merge branch 'master' into container-value
  • Loading branch information
linas committed Jan 25, 2025
commit 9699f485ad682e1ec3c78d29710cfbef3cab1a49
4 changes: 4 additions & 0 deletions opencog/atoms/pattern/PatternLink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,17 @@ void PatternLink::setAtomSpace(AtomSpace* as)
{
RuleLink::setAtomSpace(as);

// Can be called with null pointer during destruction.
if (nullptr == as) return;

// All patterns will record results into thread-safe queues or to
// thread-safe deduplicated sets. Use a set by default. User can
// over-ride later, as desired.
// Start in closed state, otherwise it will hang in update()
// when printing.
SetValuePtr svp = createSetValue();
svp->close();

const Handle& self(get_handle());
as->set_value(self, self, svp);
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.