summaryrefslogtreecommitdiff
path: root/src/lib/cdap.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2017-08-29 13:11:43 +0000
committerSander Vrijders <[email protected]>2017-08-29 13:11:43 +0000
commitda754467efab5194084cd8eeab4a48f89d6b925e (patch)
treef6e8f9e732cc36f4f153e409b3f92cdd7c19dbae /src/lib/cdap.c
parent00aeb6ee00efa98c7e2d6d9bebeb1c4799ba1705 (diff)
parentf6b898da88e06399aedbfec87296602aef5c09c2 (diff)
downloadouroboros-da754467efab5194084cd8eeab4a48f89d6b925e.tar.gz
ouroboros-da754467efab5194084cd8eeab4a48f89d6b925e.zip
Merged in dstaesse/ouroboros/be-fqueue (pull request #574)
dev: Revise fqueue API and add man pages
Diffstat (limited to 'src/lib/cdap.c')
-rw-r--r--src/lib/cdap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/cdap.c b/src/lib/cdap.c
index 5ed86ad1..7d2feae3 100644
--- a/src/lib/cdap.c
+++ b/src/lib/cdap.c
@@ -52,7 +52,7 @@ struct fd_el {
};
struct cdap {
- flow_set_t * set;
+ fset_t * set;
fqueue_t * fq;
bool proc;
@@ -304,7 +304,7 @@ static void * sdu_reader(void * o)
ssize_t len;
buffer_t data;
- while (flow_event_wait(instance->set, instance->fq, NULL)) {
+ while (fevent(instance->set, instance->fq, NULL)) {
int fd;
set_proc(instance, true);
fd = fqueue_next(instance->fq);
@@ -440,7 +440,7 @@ struct cdap * cdap_create()
if (instance->ids == NULL)
goto fail_bmp_create;
- instance->set = flow_set_create();
+ instance->set = fset_create();
if (instance->set == NULL)
goto fail_set_create;
@@ -463,7 +463,7 @@ struct cdap * cdap_create()
fail_pthread_create:
fqueue_destroy(instance->fq);
fail_fqueue_create:
- flow_set_destroy(instance->set);
+ fset_destroy(instance->set);
fail_set_create:
bmp_destroy(instance->ids);
fail_bmp_create:
@@ -499,7 +499,7 @@ int cdap_destroy(struct cdap * instance)
fqueue_destroy(instance->fq);
- flow_set_destroy(instance->set);
+ fset_destroy(instance->set);
pthread_cond_destroy(&instance->cond);
pthread_mutex_destroy(&instance->mtx);
@@ -553,7 +553,7 @@ int cdap_add_flow(struct cdap * instance,
pthread_rwlock_wrlock(&instance->flows_lock);
- if (flow_set_add(instance->set, fd)) {
+ if (fset_add(instance->set, fd)) {
pthread_rwlock_unlock(&instance->flows_lock);
free(e);
return -1;
@@ -579,7 +579,7 @@ int cdap_del_flow(struct cdap * instance,
pthread_rwlock_wrlock(&instance->flows_lock);
- flow_set_del(instance->set, fd);
+ fset_del(instance->set, fd);
list_for_each_safe(p, h, &instance->flows) {
struct fd_el * e = list_entry(p, struct fd_el, next);