Skip to content

Commit 96a5aab

Browse files
committed
[NFC][sanitizer] Thread safety annotation for Symbolizer
1 parent 16cda01 commit 96a5aab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,17 @@ class Symbolizer final {
185185
class ModuleNameOwner {
186186
public:
187187
explicit ModuleNameOwner(Mutex *synchronized_by)
188-
: last_match_(nullptr), mu_(synchronized_by) {
188+
: mu_(synchronized_by), last_match_(nullptr) {
189189
storage_.reserve(kInitialCapacity);
190190
}
191191
const char *GetOwnedCopy(const char *str);
192192

193193
private:
194194
static const uptr kInitialCapacity = 1000;
195-
InternalMmapVector<const char*> storage_;
196-
const char *last_match_;
197195

198196
Mutex *mu_;
197+
const char *last_match_ SANITIZER_GUARDED_BY(mu_);
198+
InternalMmapVector<const char *> storage_ SANITIZER_GUARDED_BY(*mu_);
199199
} module_names_;
200200

201201
/// Platform-specific function for creating a Symbolizer object.
@@ -220,7 +220,7 @@ class Symbolizer final {
220220
// always synchronized.
221221
Mutex mu_;
222222

223-
IntrusiveList<SymbolizerTool> tools_;
223+
IntrusiveList<SymbolizerTool> tools_ SANITIZER_GUARDED_BY(mu_);
224224

225225
explicit Symbolizer(IntrusiveList<SymbolizerTool> tools);
226226

0 commit comments

Comments
 (0)