-
Couldn't load subscription status.
- Fork 84
Open
Description
With the revival of deadlock analysis (#655), it becomes more and more important that we handle behavior specific to mutex types.
Via pthread_mutexattr_settype there are the following possibilities:
-
PTHREAD_MUTEX_DEFAULT– misuse is undefined behavior -
PTHREAD_MUTEX_NORMAL– relocking deadlocks, other misuse is undefined behavior -
PTHREAD_MUTEX_ERRORCHECK– misuse returns errors -
PTHREAD_MUTEX_RECURSIVE– relocking allowed, other misuse returns errors
Additionally:
- We don't do anything smart with read-write locks (
pthread_rwlock_rdlock,pthread_rwlock_wrlock). (Fix read-write lock access handling #661) - Since some of the types are about differences in return values, we should also consider those, instead of completely ignoring them.
The different mutex types affect multiple features:
- Race detection
- Deadlock detection
- Base and Apron privatization