From b1f19a134d44b3abc0dcb83982e7e0769cf3c105 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Wed, 22 Dec 2021 12:08:37 +0100 Subject: lib: Add missing rwlock unlock in FRCT There was a missing unlock in FRCT. Also fixes some indentation. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/frct.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/frct.c b/src/lib/frct.c index 61a3fde0..a1e792af 100644 --- a/src/lib/frct.c +++ b/src/lib/frct.c @@ -273,6 +273,7 @@ static void send_frct_pkt(struct frcti * frcti) frcti->rcv_cr.seqno = frcti->rcv_cr.lwe; pthread_rwlock_unlock(&frcti->lock); + } static void __send_rdv(int fd) @@ -463,7 +464,7 @@ static void frcti_setflags(struct frcti * frcti, static bool __frcti_is_window_open(struct frcti * frcti) { struct frct_cr * snd_cr = &frcti->snd_cr; - int ret = true; + bool ret = true; pthread_rwlock_rdlock(&frcti->lock); @@ -471,7 +472,7 @@ static bool __frcti_is_window_open(struct frcti * frcti) ret = before(snd_cr->seqno, snd_cr->rwe); if (!ret) { - struct timespec now; + struct timespec now; clock_gettime(PTHREAD_COND_CLOCK, &now); @@ -485,6 +486,7 @@ static bool __frcti_is_window_open(struct frcti * frcti) diff = ts_diff_ns(&frcti->t_wnd, &now); if (diff > MAX_RDV) { pthread_mutex_unlock(&frcti->mtx); + pthread_rwlock_unlock(&frcti->lock); return false; } -- cgit v1.2.3