]> git.saurik.com Git - redis.git/blobdiff - adlist.c
list API is now thread safe
[redis.git] / adlist.c
index 03bbfb793ca614b39fd1552e381d39bf33b677cf..15b2617c05741d7c89200f6cbd09ff0eb1d4c6df 100644 (file)
--- 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.
  *