Does pthreads support the recursive mutex "lock" request method?

Does pthreads support any method for querying the number of locks of a recursive mutex?

+4
source share
1 answer

There is no official, portable way to do this.

You can make this behavior portable by tracking the very number of locks — perhaps by writing wrappers for the lock and unlock functions and creating a structure with a mutex and counting as members.

+3
source

All Articles