Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 051f9ea

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Handle race condition in launchParallelTasks
1 parent 4041222 commit 051f9ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Compiler/runtime/System_omc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ static void* System_launchParallelTasksThread(void *in)
762762
pthread_mutex_lock(&data->mutex);
763763
n = data->current++;
764764
pthread_mutex_unlock(&data->mutex);
765-
if (data->fail || data->current > data->len) break;
765+
if (data->fail || n >= data->len) break;
766766
MMC_TRY_TOP()
767767
threadData->parent = data->parent;
768768
threadData->mmc_thread_work_exit = threadData->mmc_jumper;

0 commit comments

Comments
 (0)