chore: add -Wthread-analysis and annotate (part 1/2) (#3502)

* enable -Wthread-analysis
* add missing annotations
* small fixes

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
This commit is contained in:
Kostas Kyrimis 2024-08-26 18:22:38 +03:00 committed by GitHub
parent 238bf3ee85
commit 839b1be82d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 163 additions and 147 deletions

View file

@ -71,18 +71,18 @@ class Service : public facade::ServiceInterface {
return &registry_;
}
facade::ErrorReply ReportUnknownCmd(std::string_view cmd_name);
facade::ErrorReply ReportUnknownCmd(std::string_view cmd_name) ABSL_LOCKS_EXCLUDED(mu_);
// Returns: the new state.
// if from equals the old state then the switch is performed "to" is returned.
// Otherwise, does not switch and returns the current state in the system.
// Upon switch, updates cached global state in threadlocal ServerState struct.
GlobalState SwitchState(GlobalState from, GlobalState to);
GlobalState SwitchState(GlobalState from, GlobalState to) ABSL_LOCKS_EXCLUDED(mu_);
void RequestLoadingState();
void RemoveLoadingState();
GlobalState GetGlobalState() const;
GlobalState GetGlobalState() const ABSL_LOCKS_EXCLUDED(mu_);
void ConfigureHttpHandlers(util::HttpListenerBase* base, bool is_privileged) final;
void OnConnectionClose(facade::ConnectionContext* cntx) final;