ASSERT(readThread >= 0);
record->thread[0] = readThread;
record->readClock[0] = readClock;
+ } else {
+ record->thread = NULL;
}
if (shadowval & ATOMICMASK)
record->isAtomic = 1;
return hash;
}
-
bool race_equals(struct DataRace *r1, struct DataRace *r2) {
if (r1->numframes != r2->numframes)
return false;
}
/* Check for datarace against last write. */
-
{
modelclock_t writeClock = record->writeClock;
thread_id_t writeThread = record->writeThread;
goto Exit;
}
-
-
{
/* Check for datarace against last read. */
modelclock_t readClock = READVECTOR(shadowval);
{
/* Check for datarace against last write. */
-
modelclock_t writeClock = WRITEVECTOR(shadowval);
thread_id_t writeThread = int_to_id(WRTHREADID(shadowval));
}
}
-
/** This function does race detection for a write on an expanded record. */
struct DataRace * atomfullRaceCheckWrite(thread_id_t thread, const void *location, uint64_t *shadow, ClockVector *currClock)
{
{
/* Check for datarace against last read. */
-
modelclock_t readClock = READVECTOR(shadowval);
thread_id_t readThread = int_to_id(RDTHREADID(shadowval));
{
/* Check for datarace against last write. */
-
modelclock_t writeClock = WRITEVECTOR(shadowval);
thread_id_t writeThread = int_to_id(WRTHREADID(shadowval));
}
}
-
-
/** This function does race detection on a read for an expanded record. */
struct DataRace * fullRaceCheckRead(thread_id_t thread, const void *location, uint64_t *shadow, ClockVector *currClock)
{
}
if (__builtin_popcount(copytoindex) <= 1) {
- if (copytoindex == 0) {
+ if (copytoindex == 0 && record->thread == NULL) {
int newCapacity = INITCAPACITY;
record->thread = (thread_id_t *)snapshot_malloc(sizeof(thread_id_t) * newCapacity);
record->readClock = (modelclock_t *)snapshot_malloc(sizeof(modelclock_t) * newCapacity);
{
/* Check for datarace against last write. */
-
modelclock_t writeClock = WRITEVECTOR(shadowval);
thread_id_t writeThread = int_to_id(WRTHREADID(shadowval));
}
/* Check for datarace against last write. */
-
modelclock_t writeClock = WRITEVECTOR(shadowval);
thread_id_t writeThread = int_to_id(WRTHREADID(shadowval));
}
}
-
-
void raceCheckRead64(thread_id_t thread, const void *location)
{
uint64_t old_shadowval, new_shadowval;
old_shadowval = new_shadowval = INVALIDSHADOWVAL;
-
uint64_t * shadow = raceCheckRead_firstIt(thread, location, &old_shadowval, &new_shadowval);
if (CHECKBOUNDARY(location, 7)) {
if (shadow[1]==old_shadowval)
uint64_t old_shadowval, new_shadowval;
old_shadowval = new_shadowval = INVALIDSHADOWVAL;
-
uint64_t * shadow = raceCheckRead_firstIt(thread, location, &old_shadowval, &new_shadowval);
if (CHECKBOUNDARY(location, 3)) {
if (shadow[1]==old_shadowval)
uint64_t old_shadowval, new_shadowval;
old_shadowval = new_shadowval = INVALIDSHADOWVAL;
-
raceCheckRead_firstIt(thread, location, &old_shadowval, &new_shadowval);
}
uint64_t old_shadowval, new_shadowval;
old_shadowval = new_shadowval = INVALIDSHADOWVAL;
-
uint64_t * shadow = raceCheckWrite_firstIt(thread, location, &old_shadowval, &new_shadowval);
if (CHECKBOUNDARY(location, 7)) {
if (shadow[1]==old_shadowval)
uint64_t old_shadowval, new_shadowval;
old_shadowval = new_shadowval = INVALIDSHADOWVAL;
-
uint64_t * shadow = raceCheckWrite_firstIt(thread, location, &old_shadowval, &new_shadowval);
if (CHECKBOUNDARY(location, 3)) {
if (shadow[1]==old_shadowval)
uint64_t old_shadowval, new_shadowval;
old_shadowval = new_shadowval = INVALIDSHADOWVAL;
-
uint64_t * shadow = raceCheckWrite_firstIt(thread, location, &old_shadowval, &new_shadowval);
if (CHECKBOUNDARY(location, 1)) {
if (shadow[1]==old_shadowval) {
uint64_t old_shadowval, new_shadowval;
old_shadowval = new_shadowval = INVALIDSHADOWVAL;
-
raceCheckWrite_firstIt(thread, location, &old_shadowval, &new_shadowval);
}