diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-07-05 18:07:42 +0200 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-07-08 11:02:24 +0200 |
| commit | 0562337b7aaee1c50fa840e220eba4f7478a9e82 (patch) | |
| tree | 340730f92358b80f1465177777a48e200de7dbe8 /src/lib/dev.c | |
| parent | 942e4c64ad03e537a77366c6bf1309241b71f1e8 (diff) | |
| download | ouroboros-0562337b7aaee1c50fa840e220eba4f7478a9e82.tar.gz ouroboros-0562337b7aaee1c50fa840e220eba4f7478a9e82.zip | |
lib: Clean up on cancelled blocking read
Cancelling a thread that was blocked in ssm_rbuff_read_b/write_b
didn't clean up the n_users reference. If it was in flow_rx_one it
didn't unlock the process lock.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/dev.c')
| -rw-r--r-- | src/lib/dev.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c index d0997273..c4c874cc 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -615,7 +615,12 @@ static int flow_rx_one(struct flow * flow, continue; } + pthread_cleanup_push(__cleanup_rwlock_unlock, &proc.lock); + idx = ssm_rbuff_read_b(rx_rb, &wait_abs); + + pthread_cleanup_pop(false); + if (idx == -ETIMEDOUT) { pthread_rwlock_unlock(&proc.lock); if (deadline_passed(abs)) |
