Fix issue that tc_pthread_once fail when run tc repeatly
g_once was not intialized when tc start.
Now g_once is initialized to PTHREAD_ONCE_INIT
@@ -59,7 +59,7 @@ pthread_t thread[PTHREAD_CNT];
pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t g_cond;
pthread_key_t g_tlskey;
-static pthread_once_t g_once = PTHREAD_ONCE_INIT;
+static pthread_once_t g_once;
static bool g_bpthreadcallback = false;
static int g_cnt;
@@ -1182,6 +1182,10 @@ static void tc_pthread_pthread_once(void)
{
int ret_chk;
+ /* Initialize g_once */
+
+ g_once = PTHREAD_ONCE_INIT;
+
/* Test NULL case */
g_bpthreadcallback = false;
