Merge pull request #24791 from taosdata/fix/TD-28612

fix: windows crash issue
This commit is contained in:
dapan1121 2024-02-20 19:00:23 +08:00 committed by GitHub
commit a428ed76f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 0 deletions

View File

@ -60,6 +60,7 @@ extern "C" int32_t schHandleCallback(void *param, const SDataBuf *pMsg, int32_t
int64_t insertJobRefId = 0;
int64_t queryJobRefId = 0;
bool schtJobDone = false;
uint64_t schtMergeTemplateId = 0x4;
uint64_t schtFetchTaskId = 0;
uint64_t schtQueryId = 1;
@ -450,6 +451,8 @@ void *schtSendRsp(void *param) {
schReleaseJob(job);
schtJobDone = true;
return NULL;
}
@ -1028,6 +1031,8 @@ TEST(insertTest, normalCase) {
TdThreadAttr thattr;
taosThreadAttrInit(&thattr);
schtJobDone = false;
TdThread thread1;
taosThreadCreate(&(thread1), &thattr, schtSendRsp, &insertJobRefId);
@ -1045,6 +1050,14 @@ TEST(insertTest, normalCase) {
code = schedulerExecJob(&req, &insertJobRefId);
ASSERT_EQ(code, 0);
while (true) {
if (schtJobDone) {
break;
}
taosUsleep(10000);
}
schedulerFreeJob(&insertJobRefId, 0);
schedulerDestroy();