summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ed06d81)
raw | patch | inline | side by side (parent: ed06d81)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 2 Oct 2013 09:06:08 +0000 (11:06 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 2 Oct 2013 09:06:08 +0000 (11:06 +0200) |
src/utils/llist.c | patch | blob | history |
diff --git a/src/utils/llist.c b/src/utils/llist.c
index 0d61769b26b8daea103c73e6bb3d8d31e1886be3..0af9c8cb11bec4346b96c557275b4a813ccfd618 100644 (file)
--- a/src/utils/llist.c
+++ b/src/utils/llist.c
{
sdb_llist_elem_t *elem;
- if ((! list) || (! lookup))
- return NULL;
+ assert(list && lookup);
for (elem = list->head; elem; elem = elem->next)
if (! lookup(elem->obj, user_data))
{
sdb_llist_elem_t *elem;
+ if ((! list) || (! lookup))
+ return NULL;
+
pthread_rwlock_rdlock(&list->lock);
elem = llist_search(list, lookup, user_data);
pthread_rwlock_unlock(&list->lock);
sdb_llist_elem_t *elem;
sdb_object_t *obj = NULL;
+ if ((! list) || (! lookup))
+ return NULL;
+
pthread_rwlock_wrlock(&list->lock);
elem = llist_search(list, lookup, user_data);
if (elem)