Skip to content

Commit 0231ff5

Browse files
author
Christopher Friedt
committed
Revert "tests: posix: pthread: init pthread_attr_t on each iteration"
This reverts commit 7c17bda. Signed-off-by: Christopher Friedt <[email protected]>
1 parent f972d8e commit 0231ff5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/posix/common/src/pthread.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,11 @@ ZTEST(posix_apis, test_pthread_descriptor_leak)
587587
pthread_t pthread1;
588588
pthread_attr_t attr;
589589

590+
zassert_ok(pthread_attr_init(&attr));
591+
zassert_ok(pthread_attr_setstack(&attr, &stack_e[0][0], STACKS));
592+
590593
/* If we are leaking descriptors, then this loop will never complete */
591594
for (size_t i = 0; i < CONFIG_MAX_PTHREAD_COUNT * 2; ++i) {
592-
zassert_ok(pthread_attr_init(&attr));
593-
zassert_ok(pthread_attr_setstack(&attr, &stack_e[0][0], STACKS));
594595
zassert_ok(pthread_create(&pthread1, &attr, create_thread1, NULL),
595596
"unable to create thread %zu", i);
596597
zassert_ok(pthread_join(pthread1, NULL), "unable to join thread %zu", i);

0 commit comments

Comments
 (0)