From 5a4ac21df75903007b652dfff724a01a075055e6 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Thu, 25 Mar 2021 14:31:10 +0800 Subject: [PATCH 1/2] fix crash issue --- tests/examples/c/asyncdemo.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/examples/c/asyncdemo.c b/tests/examples/c/asyncdemo.c index 16a14e9654..b9e3cdc7b5 100644 --- a/tests/examples/c/asyncdemo.c +++ b/tests/examples/c/asyncdemo.c @@ -30,6 +30,7 @@ int points = 5; int numOfTables = 3; int tablesProcessed = 0; int64_t st, et; +int done = 0; typedef struct { int id; @@ -163,6 +164,16 @@ int main(int argc, char *argv[]) getchar(); + while(1) { + if (tablesProcessed < numOfTables) { + printf("wait for process finished\n"); + sleep(1); + continue; + } + + break; + } + taos_close(taos); free(tableList); From eafc5d39a58b2f7a4a7efa141e612369d859592a Mon Sep 17 00:00:00 2001 From: dapan1121 <72057773+dapan1121@users.noreply.github.com> Date: Thu, 25 Mar 2021 14:34:50 +0800 Subject: [PATCH 2/2] Update asyncdemo.c --- tests/examples/c/asyncdemo.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/examples/c/asyncdemo.c b/tests/examples/c/asyncdemo.c index b9e3cdc7b5..d711ce22c1 100644 --- a/tests/examples/c/asyncdemo.c +++ b/tests/examples/c/asyncdemo.c @@ -30,7 +30,6 @@ int points = 5; int numOfTables = 3; int tablesProcessed = 0; int64_t st, et; -int done = 0; typedef struct { int id;