got rid of deprecated create_iterator_locked()

This commit is contained in:
Martin Willi
2008-11-05 08:32:38 +00:00
parent e10b0d0fc0
commit e13389a7f7
16 changed files with 90 additions and 92 deletions
-25
View File
@@ -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;
+1 -16
View File
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2007-2008 Tobias Brunner
* Copyright (C) 2005-2006 Martin Willi
* Copyright (C) 2005-2008 Martin Willi
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
*
@@ -27,13 +27,10 @@
typedef struct linked_list_t linked_list_t;
#include <pthread.h>
#include <library.h>
#include <utils/iterator.h>
#include <utils/enumerator.h>
/**
* Method to match elements in a linked list (used in find_* functions)
*
@@ -80,18 +77,6 @@ struct linked_list_t {
*/
iterator_t *(*create_iterator) (linked_list_t *this, bool forward);
/**
* Creates a iterator, locking a mutex.
*
* The supplied mutex is acquired immediately, and released
* when the iterator gets destroyed.
*
* @param mutex mutex to use for exclusive access
* @return new iterator_t object
*/
iterator_t *(*create_iterator_locked) (linked_list_t *this,
pthread_mutex_t *mutex);
/**
* Create an enumerator over the list.
*