We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78107e8 commit 6629805Copy full SHA for 6629805
libs/pal/posix/pal.c
@@ -121,13 +121,18 @@ static void *thread_entry_wrapper(void *arg) {
121
}
122
123
static pthread_mutex_t critical_section_mutex_ = PTHREAD_MUTEX_INITIALIZER;
124
+static char critical_section_enter_cnt_ = 0;
125
126
void am_pal_crit_enter(void) {
127
int rc = pthread_mutex_lock(&critical_section_mutex_);
128
+ AM_ASSERT(0 == critical_section_enter_cnt_);
129
+ ++critical_section_enter_cnt_;
130
AM_ASSERT(0 == rc);
131
132
133
void am_pal_crit_exit(void) {
134
+ AM_ASSERT(1 == critical_section_enter_cnt_);
135
+ --critical_section_enter_cnt_;
136
int rc = pthread_mutex_unlock(&critical_section_mutex_);
137
138
0 commit comments