fix infinitie loop (revert my previous broken PR)

This commit is contained in:
Kirill Zhumarin 2019-01-13 23:28:02 +02:00 committed by GitHub
parent 0f1531a27f
commit dd79421239
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -458,7 +458,7 @@ void mythread_queue_list_entry_make_batch(mythread_t* mythread, mythread_queue_l
return; return;
size_t i = 0; size_t i = 0;
for(size_t from = mythread->id_increase; from < mythread->entries_length; from++) { for(size_t from = mythread->id_increase; from <= mythread->entries_length; from++) {
entry->thread_param[from].use = i; entry->thread_param[from].use = i;
i++; i++;
} }
@ -469,8 +469,9 @@ void mythread_queue_list_entry_make_stream(mythread_t* mythread, mythread_queue_
if(entry == NULL || mythread == NULL) if(entry == NULL || mythread == NULL)
return; return;
for(size_t from = mythread->id_increase; from < mythread->entries_length; from++) { for(size_t from = mythread->id_increase; from <= mythread->entries_length; from++) {
entry->thread_param[from].use = 0; if (from < entry->thread_param_size)
entry->thread_param[from].use = 0;
} }
} }