From e70b6c6d9c1775ee4f53dc58eb8d71149d1b8f55 Mon Sep 17 00:00:00 2001 From: zhihaop Date: Mon, 5 Sep 2022 01:23:45 +0800 Subject: [PATCH] fix: use atomic_int instead of int --- src/client/src/tscAsync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index 2989bc8ee9..a1745fb266 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -37,18 +37,18 @@ static void tscAsyncQueryRowsForNextVnode(void *param, TAOS_RES *tres, int numOf static void tscAsyncFetchRowsProxy(void *param, TAOS_RES *tres, int numOfRows); // The async auto batch feature. -static bool asyncBatchEnable; +static atomic_bool asyncBatchEnable; // The queue store the async insertion statements static taos_queue insertionQueue; // The number of statements in the insertion queue. -static int currentBatchLen; +static atomic_int currentBatchLen; // The maximum auto batch len. static int asyncBatchLen; // The batch timeout in milliseconds. static int64_t asyncBatchTimeout; // The state of the insertion queue. While executing timeout task, the queue will set exclusive for writing // in order to make sure the statements will be sent to vnodes no more than `timeout` milliseconds. -static int exclusiveState; +static atomic_int exclusiveState; // The background thread to manage statement auto batch timeout. static pthread_t background; -- GitLab