Skip to content

Commit

Permalink
Merge pull request #764 from taosdata/merge/main_to_3.0
Browse files Browse the repository at this point in the history
fix: only linux support pthread_tryjoin_np
  • Loading branch information
DuanKuanJun committed Jun 26, 2024
2 parents e5049d8 + 846dbf7 commit 28ab0bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/benchInsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,7 @@ int32_t initInsertThread(SDataBase* database, SSuperTable* stbInfo, int32_t nthr
return ret;
}

#ifdef LINUX
#define EMPTY_SLOT -1
// run with limit thread
int32_t runInsertLimitThread(SDataBase* database, SSuperTable* stbInfo, int32_t nthreads, int32_t limitThread, threadInfo *infos, pthread_t *pids) {
Expand Down Expand Up @@ -3664,6 +3665,7 @@ int32_t runInsertLimitThread(SDataBase* database, SSuperTable* stbInfo, int32_t

return 0;
}
#endif

// run
int32_t runInsertThread(SDataBase* database, SSuperTable* stbInfo, int32_t nthreads, threadInfo *infos, pthread_t *pids) {
Expand Down Expand Up @@ -3897,7 +3899,11 @@ static int startMultiThreadInsertData(SDataBase* database, SSuperTable* stbInfo)
int64_t start = toolsGetTimestampUs();
if(g_arguments->bind_vgroup && g_arguments->nthreads < nthreads ) {
// need many batch execute all threads
#ifdef LINUX
ret = runInsertLimitThread(database, stbInfo, nthreads, g_arguments->nthreads, infos, pids);
#else
ret = runInsertThread(database, stbInfo, nthreads, infos, pids);
#endif
} else {
// only one batch execute all threads
ret = runInsertThread(database, stbInfo, nthreads, infos, pids);
Expand Down

0 comments on commit 28ab0bc

Please sign in to comment.