Skip to content

Commit 1f67dcb

Browse files
Christopher Friedtcfriedt
authored andcommitted
posix: remove deprecated non-standard PTHREAD_MUTEX_DEFINE, etc
Remove the previously deprecated and non-standard macros * PTHREAD_MUTEX_DEFINE() * PTHREAD_COND_DEFINE() Signed-off-by: Christopher Friedt <[email protected]>
1 parent 87d056b commit 1f67dcb

File tree

2 files changed

+3
-30
lines changed

2 files changed

+3
-30
lines changed

include/zephyr/posix/pthread.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,6 @@ extern "C" {
5252
*/
5353
#define PTHREAD_COND_INITIALIZER (-1)
5454

55-
/**
56-
* @brief Declare a pthread condition variable
57-
*
58-
* Declaration API for a pthread condition variable. This is not a
59-
* POSIX API, it's provided to better conform with Zephyr's allocation
60-
* strategies for kernel objects.
61-
*
62-
* @param name Symbol name of the condition variable
63-
* @deprecated Use @c PTHREAD_COND_INITIALIZER instead.
64-
*/
65-
#define PTHREAD_COND_DEFINE(name) pthread_cond_t name = PTHREAD_COND_INITIALIZER
66-
6755
/**
6856
* @brief POSIX threading compatibility API
6957
*
@@ -148,18 +136,6 @@ int pthread_condattr_setclock(pthread_condattr_t *att, clockid_t clock_id);
148136
*/
149137
#define PTHREAD_MUTEX_INITIALIZER (-1)
150138

151-
/**
152-
* @brief Declare a pthread mutex
153-
*
154-
* Declaration API for a pthread mutex. This is not a POSIX API, it's
155-
* provided to better conform with Zephyr's allocation strategies for
156-
* kernel objects.
157-
*
158-
* @param name Symbol name of the mutex
159-
* @deprecated Use @c PTHREAD_MUTEX_INITIALIZER instead.
160-
*/
161-
#define PTHREAD_MUTEX_DEFINE(name) pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER
162-
163139
/*
164140
* Mutex attributes - type
165141
*

tests/posix/common/src/pthread.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@ K_THREAD_STACK_ARRAY_DEFINE(stack_1, 1, 32);
3333
void *thread_top_exec(void *p1);
3434
void *thread_top_term(void *p1);
3535

36-
PTHREAD_MUTEX_DEFINE(lock);
37-
38-
PTHREAD_COND_DEFINE(cvar0);
39-
40-
PTHREAD_COND_DEFINE(cvar1);
41-
36+
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
37+
static pthread_cond_t cvar0 = PTHREAD_COND_INITIALIZER;
38+
static pthread_cond_t cvar1 = PTHREAD_COND_INITIALIZER;
4239
static pthread_barrier_t barrier;
4340

4441
sem_t main_sem;

0 commit comments

Comments
 (0)