Skip to content

Commit 994e189

Browse files
committed
Add _unsafe suffix to thread unsafe API
1 parent 27e3c5b commit 994e189

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

apps/examples/dpp/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ AM_NORETURN void am_assert_failure(
100100
line,
101101
am_pal_task_get_own_id()
102102
);
103-
am_event_log_pools(/*num=*/-1, log_pool);
104-
am_ao_log_event_queues(/*num=*/-1, log_queue);
103+
am_event_log_pools_unsafe(/*num=*/-1, log_pool);
104+
am_ao_log_event_queues_unsafe(/*num=*/-1, log_queue);
105105
am_pal_flush();
106106
__builtin_trap();
107107
}

docs/api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ The source code of the corresponding header file is in `onesize.h <https://githu
194194

195195
.. doxygentypedef:: am_onesize_iterate_fn
196196

197-
.. doxygenfunction:: am_onesize_iterate_over_allocated
197+
.. doxygenfunction:: am_onesize_iterate_over_allocated_unsafe
198198

199199
.. doxygenfunction:: am_onesize_get_nfree
200200

@@ -250,7 +250,7 @@ The source code of the corresponding header file is in `event.h <https://github.
250250

251251
.. doxygentypedef:: am_event_log_fn
252252

253-
.. doxygenfunction:: am_event_log_pools
253+
.. doxygenfunction:: am_event_log_pools_unsafe
254254

255255
.. doxygenfunction:: am_event_is_static
256256

@@ -504,7 +504,7 @@ The source code of the corresponding header file is in `ao.h <https://github.com
504504

505505
.. doxygenfunction:: am_ao_event_queue_is_empty
506506

507-
.. doxygenfunction:: am_ao_log_event_queues
507+
.. doxygenfunction:: am_ao_log_event_queues_unsafe
508508

509509
.. doxygenfunction:: am_ao_log_last_events
510510

libs/ao/ao.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ void am_ao_init_subscribe_list(struct am_ao_subscribe_list *sub, int nsub) {
319319
me->subscribe_list_set = true;
320320
}
321321

322-
void am_ao_log_event_queues(
322+
void am_ao_log_event_queues_unsafe(
323323
int num,
324324
void (*log)(
325325
const char *name, int i, int len, int cap, const struct am_event *event

libs/ao/ao.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ bool am_ao_event_queue_is_empty(struct am_ao *ao);
558558
* @param num the number of events to log. Use -1 to log all events.
559559
* @param log the logging callback
560560
*/
561-
void am_ao_log_event_queues(
561+
void am_ao_log_event_queues_unsafe(
562562
int num,
563563
void (*log)(
564564
const char *name, int i, int len, int cap, const struct am_event *event

libs/event/event.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,15 @@ static void am_event_log_cb(void *ctx, int index, const char *buf, int size) {
272272
log->cb(log->pool_ind, index, event, size);
273273
}
274274

275-
void am_event_log_pools(int num, am_event_log_fn cb) {
275+
void am_event_log_pools_unsafe(int num, am_event_log_fn cb) {
276276
AM_ASSERT(num != 0);
277277
AM_ASSERT(cb);
278278

279279
struct am_event_state *me = &am_event_state_;
280280
struct am_event_log_ctx ctx = {.cb = cb};
281281
for (int i = 0; i < me->npools; ++i) {
282282
ctx.pool_ind = i;
283-
am_onesize_iterate_over_allocated(
283+
am_onesize_iterate_over_allocated_unsafe(
284284
&me->pools[i], num, am_event_log_cb, &ctx
285285
);
286286
}

libs/event/event.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ struct am_event *am_event_dup(const struct am_event *event, int size);
332332
/**
333333
* Log event content callback type.
334334
*
335-
* Used as a parameter to am_event_log_pools() API.
335+
* Used as a parameter to am_event_log_pools_unsafe() API.
336336
*
337337
* @param pool_index pool index
338338
* @param event_index event_index within the pool
@@ -353,7 +353,7 @@ typedef void (*am_event_log_fn)(
353353
* @param num the number of events to log in each pool (if <0, then log all)
354354
* @param cb the logging callback
355355
*/
356-
void am_event_log_pools(int num, am_event_log_fn cb);
356+
void am_event_log_pools_unsafe(int num, am_event_log_fn cb);
357357

358358
/**
359359
* Check if event is static.

libs/onesize/onesize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void am_onesize_free_all(struct am_onesize *hnd) {
126126
hnd->crit_exit();
127127
}
128128

129-
void am_onesize_iterate_over_allocated(
129+
void am_onesize_iterate_over_allocated_unsafe(
130130
struct am_onesize *hnd, int num, am_onesize_iterate_fn cb, void *ctx
131131
) {
132132
AM_ASSERT(hnd);

libs/onesize/onesize.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ typedef void (*am_onesize_iterate_fn)(
153153
* @param cb the callback to call for each allocated memory block
154154
* @param ctx the caller's specific context to be used with the callback
155155
*/
156-
void am_onesize_iterate_over_allocated(
156+
void am_onesize_iterate_over_allocated_unsafe(
157157
struct am_onesize *hnd, int num, am_onesize_iterate_fn cb, void *ctx
158158
);
159159

0 commit comments

Comments
 (0)