halayli / lthread

lthread, a multicore enabled coroutine library written in C
Other
814 stars 82 forks source link

lthread_create not initializing new_next and sleep_next correctly? #7

Closed zoolib closed 12 years ago

zoolib commented 12 years ago

new_next and sleep_next are initialized as follows: lt->new_next.le_next = NULL; lt->new_next.le_next = NULL; lt->sleep_next.le_prev = NULL; lt->sleep_next.le_prev = NULL;

should it not be as follows? lt->new_next.le_next = NULL; lt->new_next.le_prev = NULL; lt->sleep_next.le_next = NULL; lt->sleep_next.le_prev = NULL;

halayli commented 12 years ago

The initializations are unnecessary (because of calloc) and needs to be cleaned. But the improper initialization is harmless in this case.