The sections' tests are not working correctly because the variables are copied for each section. When the construct ends, the end method is called for each copy, and the first value is restored to the variables, so the tests fail.
Proposed solution:
Make a private method that receives three parameters:
nowait: boolean
variables: Variables
tasks: Task...
Like this, the copy of the variables could be passed once for all the sections, even if there are more threads than the thread limit (execution of the recurrent part of the method).
Describe the bug
The sections' tests are not working correctly because the variables are copied for each section. When the construct ends, the end method is called for each copy, and the first value is restored to the variables, so the tests fail.
Proposed solution:
Make a private method that receives three parameters:
nowait: boolean
variables: Variables
tasks: Task...
Like this, the copy of the variables could be passed once for all the sections, even if there are more threads than the thread limit (execution of the recurrent part of the method).
Library version(s) affected
1.0.0
Steps to reproduce
The issue is easily represented in this test:
https://github.com/java-romp/jromp/blob/9ab3318abe1136b81061d4add6ab3816004528a4/src/test/java/jromp/parallel/SectionTests.java#L17-L40
Additional context, environment
No response
Logs
No response