Skip to content

Commit

Permalink
fixed some mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
iNomaD committed Dec 26, 2017
1 parent 9bd81bd commit 92fbc8f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions cds/container/wf_hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,23 @@ class WfHashtable
int k,l,n;
Hashtable* h;
bool suc;
T temp=NULL;
h = wh->H[index];
if (h.occ > h.bound) {
if (h->occ > h->bound) {
newTable();
h = wh->H[index];
}
n=0; l=h.size; suc=false;
n=0; l=h->size; suc=false;
do{
k=key(a,l,n);
atomic_store_explicit(&r, h.table[k]);//atomic
std::atomic_store_explicit(&r, h->table[k]);//atomic
if (r.oldp()){
refresh();
h = wh->H[index];
n = 0; l = h.size;
n = 0; l = h->size;
}else {
if(r.val()==0){
if(atomic_compare_exchange_strong(h.table[k] , NULL, v))//atmic
if(r.val() == NULL){
Hashtable* null_ptr = NULL;
if(std::atomic_compare_exchange_strong(&h->table[k] , null_ptr, v))//atmic
{
suc=true;
}
Expand All @@ -229,18 +229,18 @@ class WfHashtable
bool suc;

h = wh->H[index];
if (h.occ>h.bound) {
if (h->occ > h->bound) {
newTable();
h = wh->H[index];
}
n=0; l=h.size; suc=false;
n=0; l=h->size; suc=false;
do{
k = key(a,l,n);
atomic_store_explicit(&r, h.table[k]);//atomic
std::atomic_store_explicit(&r, h->table[k]);//atomic
if (r.oldp()){
refresh();
h = wh->H[index];
n=0; l=h.size;
n=0; l=h->size;
}else {
if(r.val()==0 || a=r.ADR()){
if( atomic_compare_exchange_strong(h.table[k]->val() , &r, v))//atmic
Expand All @@ -254,7 +254,7 @@ class WfHashtable
}
}while(!(suc));
if(r.val()==0){
h.occ++;
h->occ++;
}
}

Expand Down

0 comments on commit 92fbc8f

Please sign in to comment.