Skip to content

Commit be213a5

Browse files
committed
Rename am_ao_state::startup_mutex -> am_ao_state::startup_complete_mutex
1 parent aeb21a4 commit be213a5

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

libs/ao/ao.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ void am_ao_state_ctor(const struct am_ao_state_cfg *cfg) {
276276

277277
am_pal_ctor(/*arg=*/NULL);
278278

279-
me->startup_mutex = am_pal_mutex_create();
280-
am_pal_mutex_lock(me->startup_mutex);
279+
me->startup_complete_mutex = am_pal_mutex_create();
280+
am_pal_mutex_lock(me->startup_complete_mutex);
281281
me->startup_complete = false;
282282

283283
me->debug = cfg->debug;

libs/ao/cooperative/port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ bool am_ao_run_all(void) {
7777
}
7878

7979
if (AM_UNLIKELY(!me->startup_complete)) {
80-
am_pal_mutex_unlock(me->startup_mutex);
80+
am_pal_mutex_unlock(me->startup_complete_mutex);
8181
me->startup_complete = true;
8282
}
8383

libs/ao/preemptive/port.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ bool am_ao_run_all(void) {
8383

8484
if (!me->startup_complete) {
8585
/* start all AOs */
86-
am_pal_mutex_unlock(me->startup_mutex);
86+
am_pal_mutex_unlock(me->startup_complete_mutex);
8787
me->startup_complete = true;
8888
}
8989
/* wait all AOs to complete */
@@ -190,8 +190,8 @@ void am_ao_notify_unsafe(const struct am_ao *ao) { am_ao_notify(ao); }
190190

191191
void am_ao_wait_start_all(void) {
192192
const struct am_ao_state *me = &am_ao_state_;
193-
am_pal_mutex_lock(me->startup_mutex);
194-
am_pal_mutex_unlock(me->startup_mutex);
193+
am_pal_mutex_lock(me->startup_complete_mutex);
194+
am_pal_mutex_unlock(me->startup_complete_mutex);
195195
}
196196

197197
int am_ao_get_own_prio(void) {

libs/ao/state.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct am_ao_state {
5454
/** Number of runnings AOs */
5555
int aos_cnt;
5656
/** Ensure simultaneous start of all active objects. */
57-
int startup_mutex;
57+
int startup_complete_mutex;
5858
/** User callback on idle state, when no AO is running. */
5959
void (*on_idle)(void);
6060
/** Debug callback. */

0 commit comments

Comments
 (0)