diff --git a/common/include/villas/list.h b/common/include/villas/list.h index 0b83e308a..5680d285a 100644 --- a/common/include/villas/list.h +++ b/common/include/villas/list.h @@ -38,8 +38,7 @@ /** Static list initialization */ #define LIST_INIT_STATIC(l) \ __attribute__((constructor(105))) static void UNIQUE(__ctor)() {\ - if ((l)->state == State::DESTROYED) \ - vlist_init(l); \ + vlist_init(l); \ } \ __attribute__((destructor(105))) static void UNIQUE(__dtor)() { \ vlist_destroy(l, nullptr, false); \ diff --git a/common/lib/list.cpp b/common/lib/list.cpp index 4b09fe148..b1501ad45 100644 --- a/common/lib/list.cpp +++ b/common/lib/list.cpp @@ -55,8 +55,6 @@ static int cmp_sort(const void *a, const void *b, void *thunk) { int vlist_init(struct vlist *l) { - assert(l->state == State::DESTROYED); - pthread_mutex_init(&l->lock, nullptr); l->length = 0; diff --git a/common/tests/unit/list.cpp b/common/tests/unit/list.cpp index 65b08ad5a..373dc3620 100644 --- a/common/tests/unit/list.cpp +++ b/common/tests/unit/list.cpp @@ -42,7 +42,6 @@ TestSuite(list, .description = "List datastructure"); Test(list, vlist_lookup) { struct vlist l; - l.state = State::DESTROYED; vlist_init(&l); @@ -67,7 +66,6 @@ Test(list, vlist_lookup) Test(list, vlist_search) { struct vlist l; - l.state = State::DESTROYED; vlist_init(&l); @@ -108,7 +106,6 @@ static int dtor(void *ptr) Test(list, destructor) { struct vlist l; - l.state = State::DESTROYED; struct content elm; elm.destroyed = 0; @@ -128,7 +125,6 @@ Test(list, basics) uintptr_t i; int ret; struct vlist l; - l.state = State::DESTROYED; vlist_init(&l);