NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/52751: pthread_mutex_lock(3) does not return EINVAL on destroyed lock
The following reply was made to PR lib/52751; it has been noted by GNATS.
From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: lib/52751: pthread_mutex_lock(3) does not return EINVAL on
destroyed lock
Date: Wed, 22 Nov 2017 14:17:03 +0100
This seems to be undefined behaviour.
From Posix's
pthread_mutex_destroy, pthread_mutex_init - destroy and initialize a mutex
page:
A destroyed mutex object can be reinitialized using
pthread_mutex_init(); the results of otherwise referencing the object
after it has been destroyed are undefined.
and from pthread_mutex_lock:
If mutex does not refer to an initialized mutex object, the
behavior of pthread_mutex_lock(), pthread_mutex_trylock(), and
pthread_mutex_unlock() is undefined.
Martin
Home |
Main Index |
Thread Index |
Old Index