Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue are you addressing?
Closes #49
How have you addressed the issue?
There's been a lot of changes. To use taskwait from within a task, you must specify which tasks to wait on. Taskwait keeps track of whether or not it's being called from parallel space or from task space, and will selectively enact barriers depending on the behavior. If a task is being called from global space, it's treated as a barrier, but if called from within a task, it won't act as a barrier.
If you don't specify the tasks to wait on when calling taskwait from within a task, an exception is thrown. Specifying the tasks to wait on does not affect how tasks are scheduled-- the calling thread begins executing tasks as normal, but returns from taskwait when it detects that the selected tasks have completed instead of waiting when the task queue is empty.
How have you tested your patch?
Two new tests have been added, which checks to make sure that you can wait on tasks from within a task via taskwait, and another test to make sure that improper taskwait usage throws an exception.