Skip to content

Commit 82e9ce6

Browse files
Make private async_context_*_execute_sync static
Fixes #2678 The FreeRTOS, Poll, and Threadsafe async_context implementations have execute_sync functions that's set as a member of their async_context_type_t struct for use by the user-visible async_context API. These implementation functions should not be accessible by user code which chouls only use async_context_execute_sync and not the low-lever async_context_{freertos,poll,threadsafe}_execute_sync implementation. Make these private functions static like the other low-level functions in the async_context_type_t struct.
1 parent 8fcd44a commit 82e9ce6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/rp2_common/pico_async_context/async_context_freertos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static void handle_sync_func_call(async_context_t *context, async_when_pending_w
226226
xSemaphoreGive(call->sem);
227227
}
228228

229-
uint32_t async_context_freertos_execute_sync(async_context_t *self_base, uint32_t (*func)(void *param), void *param) {
229+
static uint32_t async_context_freertos_execute_sync(async_context_t *self_base, uint32_t (*func)(void *param), void *param) {
230230
async_context_freertos_t *self = (async_context_freertos_t*)self_base;
231231
hard_assert(xSemaphoreGetMutexHolder(self->lock_mutex) != xTaskGetCurrentTaskHandle());
232232
sync_func_call_t call = {0};

src/rp2_common/pico_async_context/async_context_poll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void async_context_poll_lock_check(async_context_t *self_base) {
5151
}
5252
}
5353

54-
uint32_t async_context_poll_execute_sync(__unused async_context_t *context, uint32_t (*func)(void *param), void *param) {
54+
static uint32_t async_context_poll_execute_sync(__unused async_context_t *context, uint32_t (*func)(void *param), void *param) {
5555
return func(param);
5656
}
5757

src/rp2_common/pico_async_context/async_context_threadsafe_background.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static void lock_release(async_context_threadsafe_background_t *self) {
135135
#endif
136136
}
137137

138-
uint32_t async_context_threadsafe_background_execute_sync(async_context_t *self_base, uint32_t (*func)(void *param), void *param) {
138+
static uint32_t async_context_threadsafe_background_execute_sync(async_context_t *self_base, uint32_t (*func)(void *param), void *param) {
139139
async_context_threadsafe_background_t *self = (async_context_threadsafe_background_t*)self_base;
140140
#if ASYNC_CONTEXT_THREADSAFE_BACKGROUND_MULTI_CORE
141141
if (self_base->core_num != get_core_num()) {

0 commit comments

Comments
 (0)