X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=datarace.h;h=6c92203cfd4e7d7b234dffd0bc75ef62bbe60dea;hb=4fa31aac91303266f4c87a6cd5d60cbab34135db;hp=7c24b6d56c1b400a311b0eaae5ef32e9ad0e8c31;hpb=f5305a99cba598d0de55358df103439831dd1eb2;p=model-checker.git diff --git a/datarace.h b/datarace.h index 7c24b6d..6c92203 100644 --- a/datarace.h +++ b/datarace.h @@ -49,15 +49,9 @@ void assert_race(struct DataRace *race); extern SnapVector unrealizedraces; -/** Basic encoding idea: - * (void *) Either: - * (1) points to a full record or - * - * (2) encodes the information in a 64 bit word. Encoding is as - * follows: lowest bit set to 1, next 8 bits are read thread id, next - * 23 bits are read clock vector, next 8 bites are write thread id, - * next 23 bits are write clock vector. */ - +/** + * @brief A record of information for detecting data races + */ struct RaceRecord { modelclock_t *readClock; thread_id_t *thread; @@ -81,6 +75,17 @@ struct RaceRecord { #define WRITEMASK READMASK #define WRITEVECTOR(x) (((x)>>40)&WRITEMASK) +/** + * The basic encoding idea is that (void *) either: + * -# points to a full record (RaceRecord) or + * -# encodes the information in a 64 bit word. Encoding is as + * follows: + * - lowest bit set to 1 + * - next 8 bits are read thread id + * - next 23 bits are read clock vector + * - next 8 bits are write thread id + * - next 23 bits are write clock vector + */ #define ENCODEOP(rdthread, rdtime, wrthread, wrtime) (0x1ULL | ((rdthread)<<1) | ((rdtime) << 9) | (((uint64_t)wrthread)<<32) | (((uint64_t)wrtime)<<40)) #define MAXTHREADID (THREADMASK-1)