Skip to content

Commit

Permalink
Merge pull request #32208 from vespa-engine/toregge/define-thread-loc…
Browse files Browse the repository at this point in the history
…al-blueprint-options-in-a-single-compilation-unit

Define thread local blueprint options in a single compilation unit.
  • Loading branch information
baldersheim authored Aug 21, 2024
2 parents dd3ece9 + a57b410 commit 6b7c9d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ void maybe_eliminate_self(Blueprint* &self, Blueprint::UP replacement) {

//-----------------------------------------------------------------------------

thread_local Blueprint::Options Blueprint::_opts;

Blueprint::HitEstimate
Blueprint::max(const std::vector<HitEstimate> &data)
{
Expand Down
4 changes: 2 additions & 2 deletions searchlib/src/vespa/searchlib/queryeval/blueprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ class Blueprint

private:
static Options &thread_opts() noexcept {
thread_local Options opts;
return opts;
return _opts;
}
struct BindOpts {
Options prev;
Expand Down Expand Up @@ -244,6 +243,7 @@ class Blueprint
uint32_t _id;
bool _strict;
bool _frozen;
thread_local static Options _opts;

protected:
virtual void notifyChange() {
Expand Down

0 comments on commit 6b7c9d2

Please sign in to comment.