testing/ostest: Remove the unnecessary defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-07-16 01:19:36 +08:00 committed by archer
parent 33987a76a9
commit d46dce5819
3 changed files with 8 additions and 10 deletions

View File

@ -49,7 +49,7 @@ static sem_t sem_thread_started;
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE) && CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 #if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
static void sem_cleaner(FAR void *arg) static void sem_cleaner(FAR void *arg)
{ {
printf("sem_cleaner #%u\n", (unsigned int)((uintptr_t)arg)); printf("sem_cleaner #%u\n", (unsigned int)((uintptr_t)arg));
@ -60,7 +60,7 @@ static FAR void *sem_waiter(FAR void *parameter)
{ {
int status; int status;
#if defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE) && CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 #if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
int i; int i;
/* Register some clean-up handlers */ /* Register some clean-up handlers */
@ -161,7 +161,7 @@ static FAR void *sem_waiter(FAR void *parameter)
} }
#if !defined(CONFIG_DISABLE_MQUEUE) && defined(CONFIG_CANCELLATION_POINTS) #if !defined(CONFIG_DISABLE_MQUEUE) && defined(CONFIG_CANCELLATION_POINTS)
#if defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE) && CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 #if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
static void mqueue_cleaner(FAR void *arg) static void mqueue_cleaner(FAR void *arg)
{ {
FAR mqd_t *mqcancel = (FAR mqd_t *)arg; FAR mqd_t *mqcancel = (FAR mqd_t *)arg;
@ -182,7 +182,7 @@ static FAR void *mqueue_waiter(FAR void *parameter)
char msgbuffer[CONFIG_MQ_MAXMSGSIZE]; char msgbuffer[CONFIG_MQ_MAXMSGSIZE];
size_t nbytes; size_t nbytes;
#if defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE) && CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 #if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
/* Register clean-up handler */ /* Register clean-up handler */
pthread_cleanup_push(mqueue_cleaner, (FAR void *)&mqcancel); pthread_cleanup_push(mqueue_cleaner, (FAR void *)&mqcancel);
@ -249,7 +249,7 @@ static FAR void *asynch_waiter(FAR void *parameter)
{ {
int status; int status;
#if defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE) && CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 #if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
int i; int i;
/* Register some clean-up handlers */ /* Register some clean-up handlers */

View File

@ -461,7 +461,7 @@ static int user_main(int argc, char *argv[])
pthread_rwlock_cancel_test(); pthread_rwlock_cancel_test();
check_test_memory_usage(); check_test_memory_usage();
#if defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE) && CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 #if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
/* Verify pthread cancellation cleanup handlers */ /* Verify pthread cancellation cleanup handlers */
printf("\nuser_main: pthread_cleanup test\n"); printf("\nuser_main: pthread_cleanup test\n");

View File

@ -204,8 +204,7 @@ static void test_timeout(void)
* usable state after deferred cancellation. * usable state after deferred cancellation.
*/ */
#if defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE) && CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 #if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 && defined(CONFIG_CANCELLATION_POINTS)
#ifdef CONFIG_CANCELLATION_POINTS
status = pthread_rwlock_trywrlock(&write_lock); status = pthread_rwlock_trywrlock(&write_lock);
if (status != EBUSY) if (status != EBUSY)
{ {
@ -255,8 +254,7 @@ static void test_timeout(void)
"ERROR pthread_rwlock_wrlock, status=%d\n", status); "ERROR pthread_rwlock_wrlock, status=%d\n", status);
ASSERT(false); ASSERT(false);
} }
#endif /* CONFIG_CANCELLATION_POINTS */ #endif /* CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 && CONFIG_CANCELLATION_POINTS */
#endif /* defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE) && CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 */
pthread_rwlock_destroy(&write_lock); pthread_rwlock_destroy(&write_lock);
pthread_rwlock_destroy(&read_lock); pthread_rwlock_destroy(&read_lock);