Commits

Shlomi Fish committed 7547605

Add a count_of_items_in_queue to the DBM-solver.

git-svn-id: file:///home/shlomif/Backup/svn-dumps/google-code/svnsync-repos/fc-solve/fc-solve/trunk@4533 e7e8a897-7ba4-4ee7-b36f-f4c66519b19a

  • Participants
  • Parent commits 244f169

Comments (0)

Files changed (1)

File fc-solve/source/dbm_solver.c

     /* The queue */
     
     fcs_lock_t queue_lock;
-    long count_num_processed;
+    long count_num_processed, count_of_items_in_queue;
     fcs_bool_t queue_solution_was_found;
     fcs_encoded_state_buffer_t queue_solution;
     fcs_meta_compact_allocator_t meta_alloc;
     instance->queue_num_extracted_and_processed = 0;
     instance->num_states_in_collection = 0;
     instance->count_num_processed = 0;
+    instance->count_of_items_in_queue = 0;
     instance->queue_head =
         instance->queue_tail =
         instance->queue_recycle_bin =
         {
             instance->queue_head = instance->queue_tail = new_item;
         }
+        instance->count_of_items_in_queue++;
         FCS_UNLOCK(instance->queue_lock);
     }
 }
                 {
                     instance->queue_tail = NULL;
                 }
+                instance->count_of_items_in_queue--;
                 instance->queue_num_extracted_and_processed++;
                 if (++instance->count_num_processed % 100000 == 0)
                 {
 #endif
         instance.num_states_in_collection++;
         instance.queue_head = instance.queue_tail = first_item;
+        instance.count_of_items_in_queue++;
     }
     {
         int i, check;