use tus_server_lock / tus_server_unlock

parent 9efe1ff6
...@@ -314,7 +314,7 @@ tus_request(VRT_CTX, struct VPFX(tus_server) *tussrv, ...@@ -314,7 +314,7 @@ tus_request(VRT_CTX, struct VPFX(tus_server) *tussrv,
return (0); return (0);
} }
AZ(pthread_mutex_lock(&tussrv->mtx)); tus_server_lock(tussrv);
if (m == POST) { if (m == POST) {
r->fcore = tus_file_new(ctx, tussrv, type, url, id, metadata); r->fcore = tus_file_new(ctx, tussrv, type, url, id, metadata);
...@@ -326,7 +326,7 @@ tus_request(VRT_CTX, struct VPFX(tus_server) *tussrv, ...@@ -326,7 +326,7 @@ tus_request(VRT_CTX, struct VPFX(tus_server) *tussrv,
r->schemeauth = WS_Copy(ctx->ws, tussrv->schemeauth, -1); r->schemeauth = WS_Copy(ctx->ws, tussrv->schemeauth, -1);
lock = tus_file_trylock(&r->fcore); lock = tus_file_trylock(&r->fcore);
AZ(pthread_mutex_unlock(&tussrv->mtx)); tus_server_unlock(tussrv);
if (lock == EBUSY) { if (lock == EBUSY) {
AZ(r->fcore); AZ(r->fcore);
......
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