File tree Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 1010
1111#include <assert.h>
1212
13- #include "lock_ops.h"
14- #include "macros.h"
15-
1613#define ASSERT assert
1714#define ASSERT_MSG (__cond , __msg ) assert((__cond) && (__msg))
1815#define ASSERT_NOT_NULL (__var ) assert(__var != NULL)
2219#define ASSERT_EGL_TRUE (__var ) assert((__var) == EGL_TRUE)
2320#define ASSERT_EGL_TRUE_MSG (__var , __msg ) ASSERT_MSG((__var) == EGL_TRUE, __msg)
2421
25- #ifdef DEBUG
26- static inline void assert_mutex_locked (pthread_mutex_t * mutex ) {
27- int result = pthread_mutex_trylock (mutex );
28- if (result == 0 ) {
29- pthread_mutex_unlock (mutex );
30- ASSERT_MSG (false, "Mutex is not locked." );
31- }
32- }
33- #else
34- static inline void assert_mutex_locked (mutex_t * mutex ) {
35- (void ) mutex ;
36- }
37- #endif
38-
3922#define ASSERT_ZERO (__var ) assert((__var) == 0)
4023#define ASSERT_ZERO_MSG (__var , __msg ) ASSERT_MSG((__var) == 0, __msg)
4124
Original file line number Diff line number Diff line change 5959 (void) ok; \
6060 }
6161
62+ #ifdef DEBUG
63+ static inline void assert_mutex_locked (pthread_mutex_t * mutex ) {
64+ int result = pthread_mutex_trylock (mutex );
65+ if (result == 0 ) {
66+ pthread_mutex_unlock (mutex );
67+ ASSERT_MSG (false, "Mutex is not locked." );
68+ }
69+ }
70+ #else
71+ static inline void assert_mutex_locked (mutex_t * mutex ) {
72+ (void ) mutex ;
73+ }
74+ #endif
75+
6276#endif // _FLUTTERPI_SRC_UTIL_LOCK_OPS_H
You can’t perform that action at this time.
0 commit comments