u_int segment;
/**
+ * currently enumerating entry
+ */
+ entry_t *entry;
+
+ /**
* current table row index
*/
u_int row;
*/
static bool enumerate(private_enumerator_t *this, entry_t **entry, u_int *segment)
{
+ if (this->entry)
+ {
+ this->entry->condvar->signal(this->entry->condvar);
+ this->entry = NULL;
+ }
while (this->segment < this->manager->segment_count)
{
while (this->row < this->manager->table_size)
if (this->current)
{
entry_t *item;
-
+
if (this->current->enumerate(this->current, (void**)&item))
{
- *entry = item;
+ *entry = this->entry = item;
*segment = this->segment;
return TRUE;
}
else
{
linked_list_t *list;
-
+
lock_single_segment(this->manager, this->segment);
if ((list = this->manager->ike_sa_table[this->row]) != NULL &&
list->get_count(list))
*/
static void enumerator_destroy(private_enumerator_t *this)
{
+ if (this->entry)
+ {
+ this->entry->condvar->signal(this->entry->condvar);
+ }
if (this->current)
{
this->current->destroy(this->current);
enumerator->enumerator.destroy = (void*)enumerator_destroy;
enumerator->manager = this;
enumerator->segment = 0;
+ enumerator->entry = NULL;
enumerator->row = 0;
enumerator->current = NULL;
*/
static void remove_entry_at(private_enumerator_t *this)
{
+ this->entry = NULL;
if (this->current)
{
linked_list_t *list = this->manager->ike_sa_table[this->row];