This is the mail archive of the
mailing list for the glibc project.
Re: Pthread mutex lock validator
sanketh nalli wrote:
> I started with this project. But i soon, realised that it may not
> be possible.
> And the custom pthread_mutex_t has to store
> some extra information to help detect recursive locking,
One way would be to keep a separate table that stores that extra
information for each (pthread_mutex_t *) value encountered.
As POSIX explains under the heading pthread_mutex_init(), the effect
of referring to copies of a mutex in calls to pthread_mutex_lock(),
..._unlock(), and so on is undefined, so the address of a mutex should
work as a key and this doesn't require any knowledge of what is inside
Hope that helps,