RTEMS: Optimize pthread_once_t
Reduce size of pthread_once_t and make it zero-initialized. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
This commit is contained in:
parent
f9b24fad7c
commit
4fef7312b3
|
@ -41,12 +41,11 @@ typedef __uint32_t tss_t;
|
||||||
|
|
||||||
/* pthread_once_t */
|
/* pthread_once_t */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int _is_initialized;
|
unsigned char _flags;
|
||||||
int _init_executed;
|
|
||||||
} once_flag;
|
} once_flag;
|
||||||
|
|
||||||
/* PTHREAD_ONCE_INIT */
|
/* PTHREAD_ONCE_INIT */
|
||||||
#define ONCE_FLAG_INIT { 1, 0 }
|
#define ONCE_FLAG_INIT { 0 }
|
||||||
|
|
||||||
/* PTHREAD_DESTRUCTOR_ITERATIONS */
|
/* PTHREAD_DESTRUCTOR_ITERATIONS */
|
||||||
#define TSS_DTOR_ITERATIONS 4
|
#define TSS_DTOR_ITERATIONS 4
|
||||||
|
|
|
@ -169,11 +169,11 @@ typedef struct {
|
||||||
typedef __uint32_t pthread_key_t; /* thread-specific data keys */
|
typedef __uint32_t pthread_key_t; /* thread-specific data keys */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int is_initialized; /* is this structure initialized? */
|
unsigned char _flags;
|
||||||
int init_executed; /* has the initialization routine been run? */
|
} pthread_once_t;
|
||||||
} pthread_once_t; /* dynamic package initialization */
|
|
||||||
|
#define _PTHREAD_ONCE_INIT { 0 }
|
||||||
|
|
||||||
#define _PTHREAD_ONCE_INIT { 1, 0 } /* is initialized and not run */
|
|
||||||
#endif /* defined(_POSIX_THREADS) */
|
#endif /* defined(_POSIX_THREADS) */
|
||||||
|
|
||||||
/* POSIX Barrier Types */
|
/* POSIX Barrier Types */
|
||||||
|
|
Loading…
Reference in New Issue