[NFC][sanitizer] Thread safety annotation for Symbolizer

This commit is contained in:
Vitaly Buka
2024-09-04 20:22:27 -07:00
parent 16cda01d22
commit 96a5aabbd6

View File

@@ -185,17 +185,17 @@ class Symbolizer final {
class ModuleNameOwner {
public:
explicit ModuleNameOwner(Mutex *synchronized_by)
: last_match_(nullptr), mu_(synchronized_by) {
: mu_(synchronized_by), last_match_(nullptr) {
storage_.reserve(kInitialCapacity);
}
const char *GetOwnedCopy(const char *str);
private:
static const uptr kInitialCapacity = 1000;
InternalMmapVector<const char*> storage_;
const char *last_match_;
Mutex *mu_;
const char *last_match_ SANITIZER_GUARDED_BY(mu_);
InternalMmapVector<const char *> storage_ SANITIZER_GUARDED_BY(*mu_);
} module_names_;
/// Platform-specific function for creating a Symbolizer object.
@@ -220,7 +220,7 @@ class Symbolizer final {
// always synchronized.
Mutex mu_;
IntrusiveList<SymbolizerTool> tools_;
IntrusiveList<SymbolizerTool> tools_ SANITIZER_GUARDED_BY(mu_);
explicit Symbolizer(IntrusiveList<SymbolizerTool> tools);