File libgomp/config/posix95/lock.c
It implemnts recursive mutexes with the intuitive idea (in the header)
typedef struct
{
pthread_mutex_t lock;
pthread_t owner;
int count;
} omp_nest_lock_t;
However when this is implemented in config/posix95/lock.c
void
omp_unset_nest_lock (omp_nest_lock_t *lock)
{
lock->count--;
if (lock->count == 0)
{
lock->owner = (pthread_t) 0;
pthread_mutex_unlock (&lock->lock);
}
}
Now I am looking my posix stanard IEEE POSIX 1003.1 (95) and I cannt see
nowhere why a thread shouldnt have ID 0. Moreover why this ID 0 thread
should be the main thread necessarily! It usually is but this is not what
the API requires.
Is anybody happens to have a later version that advises that thread ID 0
is really a null thread? or must be the leading thread on each process?
I would be greatful if you could advise on this.
Regards,