File tree Expand file tree Collapse file tree 2 files changed +58
-27
lines changed Expand file tree Collapse file tree 2 files changed +58
-27
lines changed Original file line number Diff line number Diff line change @@ -17,29 +17,15 @@ struct timespec {
17
17
s32_t tv_sec ;
18
18
s32_t tv_nsec ;
19
19
};
20
- #endif
20
+ #endif /* CONFIG_NEWLIB_LIBC */
21
+
22
+ #include "sys/types.h"
21
23
22
24
static inline s32_t _ts_to_ms (const struct timespec * to )
23
25
{
24
26
return (to -> tv_sec * 1000 ) + (to -> tv_nsec / 1000000 );
25
27
}
26
28
27
- typedef struct pthread_mutex {
28
- struct k_sem * sem ;
29
- } pthread_mutex_t ;
30
-
31
- typedef struct pthread_mutexattr {
32
- int unused ;
33
- } pthread_mutexattr_t ;
34
-
35
- typedef struct pthread_cond {
36
- _wait_q_t wait_q ;
37
- } pthread_cond_t ;
38
-
39
- typedef struct pthread_condattr {
40
- int unused ;
41
- } pthread_condattr_t ;
42
-
43
29
/**
44
30
* @brief Declare a pthread condition variable
45
31
*
@@ -260,16 +246,6 @@ static inline int pthread_mutexattr_destroy(pthread_mutexattr_t *m)
260
246
/* #define PTHREAD_MUTEX_INITIALIZER */
261
247
/* #define PTHREAD_COND_INITIALIZER */
262
248
263
- typedef struct pthread_barrier {
264
- _wait_q_t wait_q ;
265
- int max ;
266
- int count ;
267
- } pthread_barrier_t ;
268
-
269
- typedef struct pthread_barrierattr {
270
- int unused ;
271
- } pthread_barrierattr_t ;
272
-
273
249
/**
274
250
* @brief Declare a pthread barrier
275
251
*
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2018 Intel Corporation
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ #ifndef __POSIX_TYPES_H__
8
+ #define __POSIX_TYPES_H__
9
+
10
+
11
+ #ifdef __cplusplus
12
+ extern "C" {
13
+ #endif
14
+
15
+ #ifdef CONFIG_NEWLIB_LIBC
16
+ #include_next <sys/types.h>
17
+ #endif /* CONFIG_NEWLIB_LIBC */
18
+
19
+ #ifdef CONFIG_PTHREAD_IPC
20
+ /* Mutex */
21
+ typedef struct pthread_mutex {
22
+ struct k_sem * sem ;
23
+ } pthread_mutex_t ;
24
+
25
+ typedef struct pthread_mutexattr {
26
+ int unused ;
27
+ } pthread_mutexattr_t ;
28
+
29
+ /* Confition Variables */
30
+ typedef struct pthread_cond {
31
+ _wait_q_t wait_q ;
32
+ } pthread_cond_t ;
33
+
34
+ typedef struct pthread_condattr {
35
+ int unused ;
36
+ } pthread_condattr_t ;
37
+
38
+ /* Barrier */
39
+ typedef struct pthread_barrier {
40
+ _wait_q_t wait_q ;
41
+ int max ;
42
+ int count ;
43
+ } pthread_barrier_t ;
44
+
45
+ typedef struct pthread_barrierattr {
46
+ int unused ;
47
+ } pthread_barrierattr_t ;
48
+
49
+ #endif /* CONFIG_PTHREAD_IPC */
50
+
51
+ #ifdef __cplusplus
52
+ }
53
+ #endif
54
+
55
+ #endif /* __POSIX_TYPES_H__ */
You can’t perform that action at this time.
0 commit comments