pthread_mutex_consistent (&q->mutex);
}
+static int
+svm_queue_trylock (svm_queue_t * q)
+{
+ int rv = pthread_mutex_trylock (&q->mutex);
+ if (PREDICT_FALSE (rv == EOWNERDEAD))
+ rv = pthread_mutex_consistent (&q->mutex);
+ return rv;
+}
+
void
svm_queue_unlock (svm_queue_t * q)
{
if (nowait)
{
/* zero on success */
- if (pthread_mutex_trylock (&q->mutex))
+ if (svm_queue_trylock (q))
{
return (-1);
}
if (nowait)
{
/* zero on success */
- if (pthread_mutex_trylock (&q->mutex))
+ if (svm_queue_trylock (q))
{
return (-1);
}
if (cond == SVM_Q_NOWAIT)
{
/* zero on success */
- if (pthread_mutex_trylock (&q->mutex))
+ if (svm_queue_trylock (q))
{
return (-1);
}