summaryrefslogtreecommitdiffstats
path: root/src/svm/message_queue.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-11-27 09:49:10 -0800
committerDave Barach <openvpp@barachs.net>2020-11-30 16:05:59 +0000
commit2440a8a6e72a1fb156fce3f38ef3ae8cd2a527d8 (patch)
treeda054371c94e55e691458f30b2279214d25ec01d /src/svm/message_queue.h
parent7d8a956287e2b19059f041c77a57480f437fe2bf (diff)
svm: make svm queue mutex robust
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I256774c25b3c4105139a4728724a1a0c775e740f
Diffstat (limited to 'src/svm/message_queue.h')
-rw-r--r--src/svm/message_queue.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/svm/message_queue.h b/src/svm/message_queue.h
index 37293fc29d1..13f4d80d215 100644
--- a/src/svm/message_queue.h
+++ b/src/svm/message_queue.h
@@ -311,7 +311,10 @@ svm_msg_q_try_lock (svm_msg_q_t * mq)
static inline int
svm_msg_q_lock (svm_msg_q_t * mq)
{
- return pthread_mutex_lock (&mq->q->mutex);
+ int rv = pthread_mutex_lock (&mq->q->mutex);
+ if (PREDICT_FALSE (rv == EOWNERDEAD))
+ rv = pthread_mutex_consistent (&mq->q->mutex);
+ return rv;
}
/**