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

Remove lock in FunctionManager #2273

Merged
merged 3 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/common/filter/FunctionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ FunctionManager::get(const std::string &func, size_t arity) {
StatusOr<FunctionManager::Function>
FunctionManager::getInternal(const std::string &func, size_t arity) const {
auto status = Status::OK();
folly::RWSpinLock::ReadHolder holder(lock_);
// check existence
auto iter = functions_.find(func);
if (iter == functions_.end()) {
Expand Down
1 change: 0 additions & 1 deletion src/common/filter/FunctionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class FunctionManager final {
Function body_;
};

mutable folly::RWSpinLock lock_;
std::unordered_map<std::string, FunctionAttributes> functions_;
Copy link
Contributor

@Shylock-Hg Shylock-Hg Aug 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'd better mark it const.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not help due to ref counter use atomic operation.

};

Expand Down