summaryrefslogtreecommitdiff
path: root/adlist.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2010-01-13 13:18:07 -0500
committerantirez <antirez@gmail.com>2010-01-13 13:18:07 -0500
commitc7df85a484f6526a00f9748490600a227587b3c3 (patch)
treeb9c45f9dd1fa11a4d1d3191297aea7fecbea9aad /adlist.c
parentb74880b4ed84693e484efbbb5eef0eb98c37835b (diff)
downloadredis-c7df85a484f6526a00f9748490600a227587b3c3.tar.gz
list API is now thread safe
Diffstat (limited to 'adlist.c')
-rw-r--r--adlist.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/adlist.c b/adlist.c
index 03bbfb793..15b2617c0 100644
--- a/adlist.c
+++ b/adlist.c
@@ -165,14 +165,14 @@ void listReleaseIterator(listIter *iter) {
}
/* Create an iterator in the list private iterator structure */
-void listRewind(list *list) {
- list->iter.next = list->head;
- list->iter.direction = AL_START_HEAD;
+void listRewind(list *list, listIter *li) {
+ li->next = list->head;
+ li->direction = AL_START_HEAD;
}
-void listRewindTail(list *list) {
- list->iter.next = list->tail;
- list->iter.direction = AL_START_TAIL;
+void listRewindTail(list *list, listIter *li) {
+ li->next = list->tail;
+ li->direction = AL_START_TAIL;
}
/* Return the next element of an iterator.
@@ -202,11 +202,6 @@ listNode *listNext(listIter *iter)
return current;
}
-/* List Yield just call listNext() against the list private iterator */
-listNode *listYield(list *list) {
- return listNext(&list->iter);
-}
-
/* Duplicate the whole list. On out of memory NULL is returned.
* On success a copy of the original list is returned.
*