got rid of deprecated create_iterator_locked()
This commit is contained in:
@@ -120,11 +120,6 @@ struct private_iterator_t {
|
||||
*/
|
||||
bool forward;
|
||||
|
||||
/**
|
||||
* Mutex to use to synchronize access
|
||||
*/
|
||||
pthread_mutex_t *mutex;
|
||||
|
||||
/**
|
||||
* iteration hook
|
||||
*/
|
||||
@@ -428,10 +423,6 @@ static void insert_after(private_iterator_t *iterator, void *item)
|
||||
*/
|
||||
static void iterator_destroy(private_iterator_t *this)
|
||||
{
|
||||
if (this->mutex)
|
||||
{
|
||||
pthread_mutex_unlock(this->mutex);
|
||||
}
|
||||
free(this);
|
||||
}
|
||||
|
||||
@@ -806,26 +797,11 @@ static iterator_t *create_iterator(private_linked_list_t *linked_list, bool forw
|
||||
this->forward = forward;
|
||||
this->current = NULL;
|
||||
this->list = linked_list;
|
||||
this->mutex = NULL;
|
||||
this->hook = iterator_hook;
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of linked_list_t.create_iterator_locked.
|
||||
*/
|
||||
static iterator_t *create_iterator_locked(private_linked_list_t *linked_list,
|
||||
pthread_mutex_t *mutex)
|
||||
{
|
||||
private_iterator_t *this = (private_iterator_t*)create_iterator(linked_list, TRUE);
|
||||
this->mutex = mutex;
|
||||
|
||||
pthread_mutex_lock(mutex);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
@@ -835,7 +811,6 @@ linked_list_t *linked_list_create()
|
||||
|
||||
this->public.get_count = (int (*) (linked_list_t *)) get_count;
|
||||
this->public.create_iterator = (iterator_t * (*) (linked_list_t *,bool))create_iterator;
|
||||
this->public.create_iterator_locked = (iterator_t * (*) (linked_list_t *,pthread_mutex_t*))create_iterator_locked;
|
||||
this->public.create_enumerator = (enumerator_t*(*)(linked_list_t*))create_enumerator;
|
||||
this->public.get_first = (status_t (*) (linked_list_t *, void **item))get_first;
|
||||
this->public.get_last = (status_t (*) (linked_list_t *, void **item))get_last;
|
||||
|
||||
Reference in New Issue
Block a user