diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-11-30 12:39:09 +0000 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-11-30 12:39:09 +0000 |
commit | 113e8f65b6294a46d472b99e39fc9f6d993e808b (patch) | |
tree | 1320c39d38bac8f665e70d7bb4e5fb7c572aeefb /src/lib/shm_rbuff.c | |
parent | ea71b87be592fec7eb8f5ae0707503c4f0fba8be (diff) | |
parent | 0b6c8e3b7d10c44ccb5330a81e90cf1b4cae4dfb (diff) | |
download | ouroboros-113e8f65b6294a46d472b99e39fc9f6d993e808b.tar.gz ouroboros-113e8f65b6294a46d472b99e39fc9f6d993e808b.zip |
Merged in dstaesse/ouroboros/be-cbr (pull request #311)
Some fixes
Diffstat (limited to 'src/lib/shm_rbuff.c')
-rw-r--r-- | src/lib/shm_rbuff.c | 10 |
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) |