Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lexborisov/Modest.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander <lex.borisov@gmail.com>2019-01-14 14:51:09 +0300
committerGitHub <noreply@github.com>2019-01-14 14:51:09 +0300
commit4b279a32dc331dfb8369b33a7fbfa02bf4303919 (patch)
treec18e0c8a8b921f9222cc62b3ebf3e672d47051cd
parent0f1531a27f32f93eab144007ef48fcc986b54525 (diff)
parentdd794212390f3dfd9852bcf6602d88c918dfd26a (diff)
Merge pull request #63 from Azq2/patch-1
fix infinitie loop (revert my previous broken PR)
-rw-r--r--source/mycore/thread_queue.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/mycore/thread_queue.c b/source/mycore/thread_queue.c
index bca2470..862a2a3 100644
--- a/source/mycore/thread_queue.c
+++ b/source/mycore/thread_queue.c
@@ -458,7 +458,7 @@ void mythread_queue_list_entry_make_batch(mythread_t* mythread, mythread_queue_l
return;
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;
i++;
}
@@ -469,8 +469,9 @@ void mythread_queue_list_entry_make_stream(mythread_t* mythread, mythread_queue_
if(entry == NULL || mythread == NULL)
return;
- for(size_t from = mythread->id_increase; from < mythread->entries_length; from++) {
- entry->thread_param[from].use = 0;
+ for(size_t from = mythread->id_increase; from <= mythread->entries_length; from++) {
+ if (from < entry->thread_param_size)
+ entry->thread_param[from].use = 0;
}
}