This patch wrap the recursive mutex tc code snippet with CONFIG_PTHREAD_MUTEX_TYPES
as recursive mutex needs CONFIG_PTHREAD_MUTEX_TYPES enabled.
and removes unnecessary condition check in kernel_tc_main.
Signed-off-by: Lokesh B V <lokesh.bv@partner.samsung.com>
#endif
#ifdef CONFIG_TC_KERNEL_LIBC_PTHREAD
-#if (!defined CONFIG_PTHREAD_MUTEX_TYPES)
-#error CONFIG_PTHREAD_MUTEX_TYPES is needed for testing LIBC_PTHREAD TC
-#endif
libc_pthread_main();
#endif
#endif
#ifdef CONFIG_TC_KERNEL_PTHREAD
-#if (!defined CONFIG_PTHREAD_MUTEX_TYPES)
-#error CONFIG_PTHREAD_MUTEX_TYPES is needed for testing PTHREAD TC
-#endif
pthread_main();
#endif
sleep(SEC_2);
+#ifdef CONFIG_PTHREAD_MUTEX_TYPES
/* initalize mutex with PTHREAD_MUTEX_RECURSIVE attribute */
pthread_mutex_init(&g_mutex, &attr);
ret_chk = pthread_mutex_unlock(&g_mutex);
TC_ASSERT_EQ("pthread_mutex_unlock", ret_chk, OK);
+#endif
/* mutex_lock mutex_unlock check through multi threads */
g_mutex_cnt = 0;