Commit 584623de authored by Shivaji's avatar Shivaji

removed print statements

parent f5f8b956
......@@ -16,7 +16,7 @@
struct KV *array[MAX_SIZE];
struct queue *qu=NULL;
struct queue *last;
unsigned _Atomic lock;
unsigned _Atomic lock=0;
void remove_element_from_deque(char *key)
......@@ -76,6 +76,7 @@ void insert_into_queue(char *key)
int remove_front_element()
{
while(ATOMIC_TEST_AND_SET(&(lock),1) == 1);
queue *temp = qu;
qu = qu->next;
assert(temp != NULL);
......@@ -90,11 +91,11 @@ int remove_front_element()
return i;
}
}
CLEAR(&(lock),0);
}
int find_empty_location()
{
while(ATOMIC_TEST_AND_SET(&(lock),1) == 1);
for(int i=0;i<MAX_SIZE;i++)
{
if(array[i]->valid == FALSE)
......@@ -104,7 +105,6 @@ int find_empty_location()
}
}
int indx = remove_front_element();
CLEAR(&(lock),0);
return indx;
}
......@@ -135,7 +135,6 @@ void cache_put(char *key, char *value)
if(array[i]->key!=NULL) {
if(strcmp(array[i]->key , key) == 0)
{
printf("ENTERING INTO QUEUE\n");
indx = i;
remove_element_from_deque(key);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment