Some comments on locking

parent 1c980ecc
......@@ -346,6 +346,10 @@ tus_request(VRT_CTX, struct VPFX(tus_server) *tussrv,
assert (lock == 0);
}
// from here on, we hold a lock on fcore (if != NULL), which we either
// need to unlock or pass to the response, which unlocks via
// tus_task_free()
if (m == POST && type == TUS_FINAL) {
if (fcore == NULL) {
tus_file_final_abort(&embryo);
......@@ -361,6 +365,7 @@ tus_request(VRT_CTX, struct VPFX(tus_server) *tussrv,
} else {
AZ(pthread_mutex_lock(&tussrv->mtx));
tus_file_del(&fcore);
// unlocks fcore
AZ(pthread_mutex_unlock(&tussrv->mtx));
r->fcore = NULL;
r->status = 204;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment