Lines Matching defs:race
10 // This file is a part of ThreadSanitizer (TSan), a race detector.
90 ExpectRace *race = list->next;
91 for (; race != list; race = race->next) {
92 if (race->addr == addr && race->size == size) {
93 atomic_store_relaxed(&race->addcount,
94 atomic_load_relaxed(&race->addcount) + 1);
98 race = (ExpectRace*)internal_alloc(MBlockExpectRace, sizeof(ExpectRace));
99 race->addr = addr;
100 race->size = size;
101 race->file = f;
102 race->line = l;
103 race->desc[0] = 0;
104 atomic_store_relaxed(&race->hitcount, 0);
105 atomic_store_relaxed(&race->addcount, 1);
109 race->desc[i] = desc[i];
110 race->desc[i] = 0;
112 race->prev = list;
113 race->next = list->next;
114 race->next->prev = race;
115 list->next = race;
119 for (ExpectRace *race = list->next; race != list; race = race->next) {
120 uptr maxbegin = max(race->addr, addr);
121 uptr minend = min(race->addr + race->size, addr + size);
123 return race;
129 ExpectRace *race = FindRace(list, addr, size);
130 if (race == 0)
132 DPrintf("Hit expected/benign race: %s addr=%zx:%d %s:%d\n",
133 race->desc, race->addr, (int)race->size, race->file, race->line);
134 atomic_fetch_add(&race->hitcount, 1, memory_order_relaxed);
161 for (ExpectRace *race = list->next; race != list; race = race->next) {
163 const uptr cnt = atomic_load_relaxed(&(race->*counter));
170 if (race->line == race0->line
171 && internal_strcmp(race->file, race0->file) == 0
172 && internal_strcmp(race->desc, race0->desc) == 0) {
178 matched->PushBack(*race);
214 static void ReportMissedExpectedRace(ExpectRace *race) {
216 Printf("WARNING: ThreadSanitizer: missed expected data race\n");
218 race->desc, race->addr, race->file, race->line);
307 ExpectRace *race = dyn_ann_ctx->expect.next;
308 if (atomic_load_relaxed(&race->hitcount) == 0) {
310 ReportMissedExpectedRace(race);
312 race->prev->next = race->next;
313 race->next->prev = race->prev;
314 internal_free(race);
355 DPrintf("Add expected race: %s addr=%zx %s:%d\n", desc, mem, f, l);
363 DPrintf("Add benign race: %s addr=%zx %s:%d\n", desc, mem, f, l);
366 // FIXME: Turn it off later. WTF is benign race?1?? Go talk to Hans Boehm.