summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/shm_rbuff.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/shm_rbuff.c b/src/lib/shm_rbuff.c
index 1e97364c..5d6d30c7 100644
--- a/src/lib/shm_rbuff.c
+++ b/src/lib/shm_rbuff.c
@@ -224,9 +224,15 @@ void shm_rbuff_destroy(struct shm_rbuff * rb)
{
char fn[FN_MAX_CHARS];
- if (rb == NULL)
- return;
+ assert(rb);
+
+#ifdef CONFIG_OUROBOROS_DEBUG
+ pthread_mutex_lock(rb->lock);
+ assert(shm_rbuff_empty(rb));
+
+ pthread_mutex_unlock(rb->lock);
+#endif
sprintf(fn, SHM_RBUFF_PREFIX "%d.%d", rb->api, rb->port_id);
if (munmap(rb->shm_base, SHM_RBUFF_FILE_SIZE) == -1)