Skip to content

Commit ef95bd8

Browse files
GUIDINGLIxiaoxiang781216
authored andcommitted
pthread_cleanup: move clenup down to tls
Signed-off-by: ligd <[email protected]>
1 parent 0c734ca commit ef95bd8

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

testing/ltp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ BLACKWORDS += pthread_key_delete
156156
BLACKWORDS += pthread_setspecific
157157
BLACKWORDS += pthread_getspecific
158158
endif
159-
ifeq ($(CONFIG_PTHREAD_CLEANUP_STACKSIZE),0)
159+
ifeq ($(CONFIG_TLS_NCLEANUP),0)
160160
BLACKWORDS += pthread_cleanup_push
161161
BLACKWORDS += pthread_cleanup_pop
162162
endif

testing/ostest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ if(CONFIG_TESTING_OSTEST)
8383
list(APPEND SRCS specific.c)
8484
endif()
8585

86-
if(NOT CONFIG_PTHREAD_CLEANUP_STACKSIZE EQUAL 0)
86+
if(NOT CONFIG_TLS_NCLEANUP EQUAL 0)
8787
list(APPEND SRCS pthread_cleanup.c)
8888
endif()
8989

testing/ostest/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ifneq ($(CONFIG_TLS_NELEM),0)
7878
CSRCS += specific.c
7979
endif
8080

81-
ifneq ($(CONFIG_PTHREAD_CLEANUP_STACKSIZE),0)
81+
ifneq ($(CONFIG_TLS_NCLEANUP),0)
8282
CSRCS += pthread_cleanup.c
8383
endif
8484

testing/ostest/cancel.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static sem_t sem_thread_started;
4949
* Private Functions
5050
****************************************************************************/
5151

52-
#if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
52+
#if CONFIG_TLS_NCLEANUP > 0
5353
static void sem_cleaner(FAR void *arg)
5454
{
5555
printf("sem_cleaner #%u\n", (unsigned int)((uintptr_t)arg));
@@ -60,12 +60,12 @@ static FAR void *sem_waiter(FAR void *parameter)
6060
{
6161
int status;
6262

63-
#if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
63+
#if CONFIG_TLS_NCLEANUP > 0
6464
int i;
6565

6666
/* Register some clean-up handlers */
6767

68-
for (i = 0; i < CONFIG_PTHREAD_CLEANUP_STACKSIZE ; i++)
68+
for (i = 0; i < CONFIG_TLS_NCLEANUP ; i++)
6969
{
7070
pthread_cleanup_push(sem_cleaner, (FAR void *)((uintptr_t)(i + 1)));
7171
}
@@ -161,7 +161,7 @@ static FAR void *sem_waiter(FAR void *parameter)
161161
}
162162

163163
#if !defined(CONFIG_DISABLE_MQUEUE) && defined(CONFIG_CANCELLATION_POINTS)
164-
#if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
164+
#if CONFIG_TLS_NCLEANUP > 0
165165
static void mqueue_cleaner(FAR void *arg)
166166
{
167167
FAR mqd_t *mqcancel = (FAR mqd_t *)arg;
@@ -182,7 +182,7 @@ static FAR void *mqueue_waiter(FAR void *parameter)
182182
char msgbuffer[CONFIG_MQ_MAXMSGSIZE];
183183
size_t nbytes;
184184

185-
#if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
185+
#if CONFIG_TLS_NCLEANUP > 0
186186
/* Register clean-up handler */
187187

188188
pthread_cleanup_push(mqueue_cleaner, (FAR void *)&mqcancel);
@@ -249,12 +249,12 @@ static FAR void *asynch_waiter(FAR void *parameter)
249249
{
250250
int status;
251251

252-
#if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
252+
#if CONFIG_TLS_NCLEANUP > 0
253253
int i;
254254

255255
/* Register some clean-up handlers */
256256

257-
for (i = 0; i < CONFIG_PTHREAD_CLEANUP_STACKSIZE ; i++)
257+
for (i = 0; i < CONFIG_TLS_NCLEANUP ; i++)
258258
{
259259
pthread_cleanup_push(sem_cleaner,
260260
(FAR void *)((uintptr_t)(i + 1)));

testing/ostest/ostest_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ static int user_main(int argc, char *argv[])
470470
pthread_rwlock_cancel_test();
471471
check_test_memory_usage();
472472

473-
#if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0
473+
#if CONFIG_TLS_NCLEANUP > 0
474474
/* Verify pthread cancellation cleanup handlers */
475475

476476
printf("\nuser_main: pthread_cleanup test\n");

testing/ostest/pthread_rwlock_cancel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static void test_timeout(void)
204204
* usable state after deferred cancellation.
205205
*/
206206

207-
#if CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 && defined(CONFIG_CANCELLATION_POINTS)
207+
#if CONFIG_TLS_NCLEANUP > 0 && defined(CONFIG_CANCELLATION_POINTS)
208208
status = pthread_rwlock_trywrlock(&write_lock);
209209
if (status != EBUSY)
210210
{
@@ -254,7 +254,7 @@ static void test_timeout(void)
254254
"ERROR pthread_rwlock_wrlock, status=%d\n", status);
255255
ASSERT(false);
256256
}
257-
#endif /* CONFIG_PTHREAD_CLEANUP_STACKSIZE > 0 && CONFIG_CANCELLATION_POINTS */
257+
#endif /* CONFIG_TLS_NCLEANUP > 0 && CONFIG_CANCELLATION_POINTS */
258258

259259
pthread_rwlock_destroy(&write_lock);
260260
pthread_rwlock_destroy(&read_lock);

0 commit comments

Comments
 (0)