Skip to content

Commit

Permalink
Merge pull request #672 from taosdata/buildFix
Browse files Browse the repository at this point in the history
fix: windows build error for main
  • Loading branch information
gccgdb1234 committed Jun 3, 2023
2 parents 28b8b9f + a314788 commit a5ae6d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/benchInsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ static int startMultiThreadCreateChildTable(

if (g_arguments->terminate) toolsMsleep(100);

for (int i = 0; i < threads; i++) {
for (int i = 0; i < threadCnt; i++) {
threadInfo *pThreadInfo = infos + i;
g_arguments->actualChildTables += pThreadInfo->tables_created;

Expand Down Expand Up @@ -3167,6 +3167,7 @@ static int startMultiThreadInsertData(SDataBase* database,
prompt(0);

// create threads
int threadCnt = 0;
for (int i = 0; (i < threads && !g_arguments->terminate); i++) {
threadInfo *pThreadInfo = infos + i;
if (stbInfo->interlaceRows > 0) {
Expand All @@ -3176,18 +3177,15 @@ static int startMultiThreadInsertData(SDataBase* database,
pthread_create(pids + i, NULL,
syncWriteProgressive, pThreadInfo);
}
threadCnt ++;
}

int64_t start = toolsGetTimestampUs();

// wait threads
for (int i = 0; (i < threads); i++) {
if(pids[i] != 0) {
infoPrint(" pthread_join %d ...\n", i);
pthread_join(pids[i], NULL);
} else {
infoPrint(" pthread_join %d is null , not wait.\n", i);
}
for (int i = 0; i < threadCnt; i++) {
infoPrint(" pthread_join %d ...\n", i);
pthread_join(pids[i], NULL);
}

int64_t end = toolsGetTimestampUs()+1;
Expand Down
2 changes: 2 additions & 0 deletions src/benchQuery.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ static void *mixedQuery(void *sarg) {
taos_errno(res), taos_errstr(res));
if (TSDB_CODE_RPC_NETWORK_UNAVAIL ==
taos_errno(res)) {
taos_free_result(res);
return NULL;
}
}
taos_free_result(res);
continue;
}
taos_free_result(res);
Expand Down
1 change: 1 addition & 0 deletions src/benchTmq.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ static int create_topic() {
if (taos_errno(res) != 0) {
errorPrint("failed to create topic: %s, reason: %s\n",
pConsumerInfo->topicName[i], taos_errstr(res));
taos_free_result(res);
closeBenchConn(conn);
return -1;
}
Expand Down

0 comments on commit a5ae6d9

Please sign in to comment.