From the spec:
444:16-17Version 5.0 rev 2, November 2017
16 If a non-NULL value was passed for thread_num, the value returned in *thread_num indicates the
17 number of the thread in the parallel region executing the task.
It should return thread_num of the thread in the team, not the gtid?