summaryrefslogtreecommitdiff
path: root/src/lib/cdap_req.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-03-31 14:34:03 +0200
committerdimitri staessens <dimitri.staessens@ugent.be>2017-03-31 14:34:18 +0200
commit9f33d70fc92d2f0f7b6058765049bfcb41e2cca9 (patch)
tree0606be1b6746e8b4285c581158d0fe4615493b5a /src/lib/cdap_req.c
parent802088cad493c41bf6c0089e9e643edc0cd997bc (diff)
downloadouroboros-9f33d70fc92d2f0f7b6058765049bfcb41e2cca9.tar.gz
ouroboros-9f33d70fc92d2f0f7b6058765049bfcb41e2cca9.zip
lib: Cancel outstanding CDAP requests on destroy
Diffstat (limited to 'src/lib/cdap_req.c')
-rw-r--r--src/lib/cdap_req.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/cdap_req.c b/src/lib/cdap_req.c
index 0b77f266..df748058 100644
--- a/src/lib/cdap_req.c
+++ b/src/lib/cdap_req.c
@@ -175,3 +175,16 @@ void cdap_req_respond(struct cdap_req * creq,
pthread_mutex_unlock(&creq->lock);
}
+
+
+void cdap_req_cancel(struct cdap_req * creq)
+{
+ assert(creq);
+
+ pthread_mutex_lock(&creq->lock);
+
+ creq->state = REQ_NULL;
+ pthread_cond_broadcast(&creq->cond);
+
+ pthread_mutex_unlock(&creq->lock);
+}