/* Unlock objects that was locked due to this transaction */
for(i = 0; i< transinfo->numlocked; i++) {
header = mhashSearch(transinfo->objlocked[i]);// find the header address
- ((objheader_t *)header)->status &= ~(LOCK);
+ STATUS(((objheader_t *)header)) &= ~(LOCK);
}
/* Send ack to Coordinator */
objnotfound++;
} else { /* If Obj found in machine (i.e. has not moved) */
/* Check if Obj is locked by any previous transaction */
- if ((((objheader_t *)mobj)->status & LOCK) == LOCK) {
+ if ((STATUS(((objheader_t *)mobj)) & LOCK) == LOCK) {
if (version == ((objheader_t *)mobj)->version) { /* If not locked then match versions */
v_matchlock++;
} else {/* If versions don't match ...HARD ABORT */
return control;
}
} else {/* If Obj is not locked then lock object */
- ((objheader_t *)mobj)->status |= LOCK;
+ STATUS(((objheader_t *)mobj)) |= LOCK;
/*TESTING Add random wait to make transactions run for a long time such that
* we can test for soft abort case */
/* Unlock locked objects */
for(i=0; i<transinfo->numlocked; i++) {
header = (objheader_t *) mhashSearch(transinfo->objlocked[i]);
- header->status &= ~(LOCK);
+ STATUS(header) &= ~(LOCK);
}
//TODO Update location lookup table
//Add oid into a machine that is a part of the pile linked list structure
while(tmp != NULL) {
if (tmp->mid == mid) {
- if ((headeraddr->status & DIRTY) == 1) {
+ if (STATUS(headeraddr) & DIRTY) {
tmp->oidmod[tmp->nummod] = OID(headeraddr);
tmp->nummod = tmp->nummod + 1;
tmp->sum_bytes += sizeof(objheader_t) + classsize[TYPE(headeraddr)];
return NULL;
}
ptr->mid = mid;
- if ((headeraddr->status & DIRTY) == 1) {
+ if (STATUS(headeraddr) & DIRTY) {
ptr->oidmod[ptr->nummod] = OID(headeraddr);
ptr->nummod = ptr->nummod + 1;
ptr->sum_bytes += sizeof(objheader_t) + classsize[TYPE(headeraddr)];
TYPE(tmp) = type;
tmp->version = 1;
tmp->rcount = 0; //? not sure how to handle this yet
- tmp->status = 0;
- tmp->status |= NEW;
+ STATUS(tmp) = NEW;
chashInsert(record->lookupTable, OID(tmp), tmp);
return tmp;
}
objnotfound++;
} else { /* If Obj found in machine (i.e. has not moved) */
/* Check if Obj is locked by any previous transaction */
- if ((((objheader_t *)mobj)->status & LOCK) == LOCK) {
+ if (STATUS(((objheader_t *)mobj)) & LOCK) {
if (version == ((objheader_t *)mobj)->version) { /* If not locked then match versions */
v_matchlock++;
} else {/* If versions don't match ...HARD ABORT */
//return tdata->recvmsg[tdata->thread_id].rcv_status;
}
} else {/* If Obj is not locked then lock object */
- ((objheader_t *)mobj)->status |= LOCK;
+ STATUS(((objheader_t *)mobj)) |= LOCK;
//TODO Remove this for Testing
randomdelay();
/* Unlock objects that was locked due to this transaction */
for(i = 0; i< numlocked; i++) {
header = mhashSearch(objlocked[i]);// find the header address
- ((objheader_t *)header)->status &= ~(LOCK);
+ STATUS(((objheader_t *)header)) &= ~(LOCK);
}
/* Send ack to Coordinator */
/* Unlock locked objects */
for(i=0; i<transinfo->numlocked; i++) {
header = (objheader_t *) mhashSearch(transinfo->objlocked[i]);
- header->status &= ~(LOCK);
+ STATUS(header) &= ~(LOCK);
}
//TODO Update location lookup table