-
Notifications
You must be signed in to change notification settings - Fork 968
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
chore: add -Wthread-analysis and annotate (part 1/2) #3502
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,17 +43,17 @@ class IncomingSlotMigration { | |
return slots_; | ||
} | ||
|
||
const std::string GetSourceID() const { | ||
const std::string& GetSourceID() const { | ||
return source_id_; | ||
} | ||
|
||
void ReportError(dfly::GenericError err) { | ||
std::lock_guard lk(error_mu_); | ||
last_error_ = err; | ||
void ReportError(dfly::GenericError err) ABSL_LOCKS_EXCLUDED(error_mu_) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. //TODO test negative capabilities via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's an experimental flag so I rather not introduce it until it's stable. IMO it's far better though in the static analysis as it provides stronger guranteess |
||
util::fb2::LockGuard lk(error_mu_); | ||
last_error_ = std::move(err); | ||
} | ||
|
||
std::string GetErrorStr() const { | ||
std::lock_guard lk(error_mu_); | ||
std::string GetErrorStr() const ABSL_LOCKS_EXCLUDED(error_mu_) { | ||
util::fb2::LockGuard lk(error_mu_); | ||
return last_error_.Format(); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of warnings + actually cases where we forget to lock. I will fix them in a separate PR this is already getting big