}
} else {
+#ifdef DELAYCOMP
+ //TODO: check to see if we already have lock
+#endif
if(version == header->version) {
/* versions match */
softabort=1;
do {
if(node->key == key) {
- goto nextloop;
+ objheader_t * headeraddr=&((objheader_t *) node->val)[-1];
+ if(STATUS(headeraddr) & DIRTY) {
+ goto nextloop;
+ } else
+ break;
}
node = node->next;
} while(node != NULL);
unsigned int version=oidrdversion[i];
if(header->lock>0) { //not write locked
if(version != header->version) { /* versions do not match */
- oidrdlocked[numoidrdlocked++] = header;
#ifdef DELAYCOMP
transAbortProcess(oidwrlocked, numoidwrtotal);
#else
//couldn't get lock because we already have it
//check if it is the right version number
if (version!=header->version) {
- oidrdlocked[numoidrdlocked++] = header;
transAbortProcess(oidwrlocked, numoidwrtotal);
#ifdef STMSTATS
ABORTCOUNT(header);
do {
if(node->key == key) {
- goto nextloop;
+ objheader_t * headeraddr=&((objheader_t *) node->val)[-1];
+ if(STATUS(headeraddr) & DIRTY) {
+ goto nextloop;
+ }
}
node = node->next;
} while(node != NULL);
freearrays;
return TRANS_ABORT;
}
+#ifdef DELAYCOMP
+ //TODO: check to see if we already have lock
+#endif
} else { /* cannot aquire lock */
if(version == header->version) {
softabort=1;
dc_c_structs=NULL;
dc_c_list=NULL;
}
+
+// Search for an address for a given oid
+INLINE void * dc_t_chashSearch(void * key) {
+ //REMOVE HASH FUNCTION CALL TO MAKE SURE IT IS INLINED HERE
+ chashlistnode_t *node = &dc_c_table[(((unsigned INTPTR)key) & dc_c_mask)>>4];
+
+ do {
+ if(node->key == key) {
+ return node->val;
+ }
+ node = node->next;
+ } while(node != NULL);
+
+ return NULL;
+}
+
#endif
void t_chashCreate(unsigned int size, double loadfactor) {