udfc destroy mutex after thread exit

This commit is contained in:
shenglian zhou 2022-04-10 21:59:07 +08:00
parent 4d59a4a57c
commit 6f5f6896a5
2 changed files with 5 additions and 4 deletions

View File

@ -290,6 +290,7 @@ int32_t encodeRequest(char **pBuf, int32_t *pBufLen, SUdfRequest *request) {
*(int32_t *) bufBegin = request->msgLen;
*pBuf = bufBegin;
*pBufLen = request->msgLen;
debugPrint("\tLen: estimate: %d, actual:%d", len, *pBufLen);
return 0;
}
@ -932,9 +933,9 @@ int32_t stopUdfService() {
uv_process_kill(&gUdfdProcess, SIGINT);
}
uv_async_send(&gUdfLoopStopAsync);
uv_mutex_destroy(&gUdfTaskQueueMutex);
uv_thread_join(&gUdfLoopThread);
return 0; gUdfcState = UDFC_STATUS_FINAL;
uv_mutex_destroy(&gUdfTaskQueueMutex);
gUdfcState = UDFC_STATUS_FINAL;
return 0;
}

View File

@ -181,7 +181,7 @@ void udfdProcessRequest(uv_work_t *req) {
}
void udfdOnWrite(uv_write_t *req, int status) {
debugPrint("%s", "after writing to pipe");
debugPrint("%s", "server after writing to pipe");
if (status < 0) {
debugPrint("Write error %s", uv_err_name(status));
}
@ -205,7 +205,7 @@ void udfdSendResponse(uv_work_t *work, int status) {
}
void udfdAllocBuffer(uv_handle_t *handle, size_t suggestedSize, uv_buf_t *buf) {
debugPrint("%s", "allocate buffer for read");
debugPrint("%s", "server allocate buffer for read");
SUdfdUvConn *ctx = handle->data;
int32_t msgHeadSize = sizeof(int32_t) + sizeof(int64_t);
if (ctx->inputCap == 0) {