In current implementation, if a regular task depends on a hidden helper task,
and when the hidden helper task is releasing its dependences, it directly calls
__kmp_omp_task. This could cause a problem that if __kmp_push_task returns
TASK_NOT_PUSHED, the task will be executed immediately. However, the hidden
helper threads are assumed to only execute hidden helper tasks. This could cause
problems because when calling __kmp_omp_task, the encountering gtid, which is
not the real one of the thread, is passed.
This patch uses __kmp_give_task, but because it is a static function, a new
wrapper __kmpc_give_task is added.
I found an interesting thing. If the encountering tid is not passed as a start point, the start point will be 0. In this case, it can happen that thread 0 tries to steal from thread 1, meanwhile thread 1 tries to steal from thread 0. Dead lock. @AndreyChurbanov Is it expected?