summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-10-13 14:06:15 +0000
committerSander Vrijders <[email protected]>2016-10-13 14:06:15 +0000
commit34f61c73f290b9f375bebb14bc48a4b15dfcc4cc (patch)
tree5192d254611ec919edf4596152ed5c041463acf2 /src/lib
parent550e7892e47cf8daf351eb773ef3900b33ecabae (diff)
parent20921b8300d1699d8b0133b3f5fc360fdd99fc0d (diff)
downloadouroboros-34f61c73f290b9f375bebb14bc48a4b15dfcc4cc.tar.gz
ouroboros-34f61c73f290b9f375bebb14bc48a4b15dfcc4cc.zip
Merged in dstaesse/ouroboros/be-dealloc (pull request #263)
lib: Fix flow deallocation logic
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dev.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index c1f769ad..348b864c 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -566,11 +566,10 @@ int flow_dealloc(int fd)
shm_ap_rbuff_close_port(ai.rb, msg.port_id);
pthread_rwlock_unlock(&ai.flows_lock);
+ pthread_rwlock_unlock(&ai.data_lock);
send_irm_msg(&msg);
- pthread_rwlock_unlock(&ai.data_lock);
-
return 0;
}
@@ -864,22 +863,6 @@ int np1_flow_dealloc(int port_id)
pthread_rwlock_wrlock(&ai.flows_lock);
fd = ai.ports[port_id].fd;
- if (fd < 0) {
- pthread_rwlock_unlock(&ai.flows_lock);
- pthread_rwlock_unlock(&ai.data_lock);
- return fd;
- }
-
- ai.flows[fd].port_id = -1;
- shm_ap_rbuff_close(ai.flows[fd].rb);
- ai.flows[fd].rb = NULL;
- ai.flows[fd].api = -1;
-
- bmp_release(ai.fds, fd);
-
- port_destroy(&ai.ports[port_id]);
-
- shm_ap_rbuff_close_port(ai.rb, port_id);
pthread_rwlock_unlock(&ai.flows_lock);
pthread_rwlock_unlock(&ai.data_lock);