Skip to content

Commit e5e6c2d

Browse files
authored
Merge pull request #14438 from Eric-A-Marks/master
Update Event Queue Documentation
2 parents 78505d5 + 4ba07d9 commit e5e6c2d

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

events/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ queue.call_every(400, printf, "called every 0.4 seconds\n");
7575

7676
The call functions return an ID that uniquely represents the event in the
7777
the event queue. You can pass this ID to `EventQueue::cancel` to cancel
78-
an in-flight event.
78+
an in-flight event prior to dispatch.
7979

8080
``` cpp
8181
// The event id uniquely represents the event in the queue
@@ -88,7 +88,7 @@ if (id) {
8888
}
8989

9090
// Events can be cancelled as long as they have not been dispatched. If the
91-
// event has already expired, cancel has no side-effects.
91+
// event has already expired, cancel may have negative side-effects.
9292
queue.cancel(id);
9393
```
9494

@@ -192,7 +192,7 @@ out of interrupt contexts.
192192
## Documentation ##
193193

194194
The in-depth documentation on specific functions can be found in
195-
[equeue.h](equeue.h).
195+
[equeue.h](include/events/equeue.h).
196196

197197
The core of the equeue library is the `equeue_t` type which represents a
198198
single event queue, and the `equeue_dispatch` function which runs the equeue,
@@ -257,7 +257,7 @@ int enet_consume(void *buffer, int size) {
257257
```
258258

259259
Additionally, in-flight events can be cancelled with `equeue_cancel`. Events
260-
are given unique ids on post, allowing safe cancellation of expired events.
260+
are given unique ids on post, allowing safe cancellation until dispatch.
261261

262262
``` c
263263
#include "equeue.h"

events/include/events/Event.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ class Event<void(ArgTs...)> {
228228

229229
/** Cancels the most recently posted event
230230
*
231-
* Attempts to cancel the most recently posted event. It is safe to call
231+
* Attempts to cancel the most recently posted event. It is not safe to call
232232
* cancel after an event has already been dispatched.
233233
*
234234
* The cancel function is IRQ safe.

events/include/events/EventQueue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
154154
/** Cancel an in-flight event
155155
*
156156
* Attempts to cancel an event referenced by the unique id returned from
157-
* one of the call functions. It is safe to call cancel after an event
157+
* one of the call functions. It is not safe to call cancel after an event
158158
* has already been dispatched.
159159
*
160160
* id must be valid i.e. event must have not finished executing.
@@ -175,7 +175,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
175175
/** Cancel an in-flight user allocated event
176176
*
177177
* Attempts to cancel an UserAllocatedEvent referenced by its address
178-
* It is safe to call cancel after an event has already been dispatched.
178+
* It is not safe to call cancel after an event has already been dispatched.
179179
*
180180
* Event must be valid i.e. event must have not finished executing
181181
* and must have been bound to this queue.

events/include/events/UserAllocatedEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class UserAllocatedEvent<F, void(ArgTs...)> {
230230

231231
/** Cancels posted event
232232
*
233-
* Attempts to cancel posted event. It is safe to call
233+
* Attempts to cancel posted event. It is not safe to call
234234
* cancel after an event has already been dispatched.
235235
*
236236
* The cancel function is IRQ safe.

events/include/events/equeue.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ void equeue_post_user_allocated(equeue_t *queue, void (*cb)(void *), void *event
195195
// Cancel an in-flight event
196196
//
197197
// Attempts to cancel an event referenced by the unique id returned from
198-
// equeue_call or equeue_post. It is safe to call equeue_cancel after an event
198+
// equeue_call or equeue_post. It is not safe to call equeue_cancel after an event
199199
// has already been dispatched.
200200
//
201201
// The equeue_cancel function is irq safe.
@@ -210,14 +210,14 @@ bool equeue_cancel(equeue_t *queue, int id);
210210
// Cancel an in-flight user allocated event
211211
//
212212
// Attempts to cancel an event referenced by its address.
213-
// It is safe to call equeue_cancel_user_allocated after an event
213+
// It is not safe to call equeue_cancel_user_allocated after an event
214214
// has already been dispatched.
215215
//
216216
// The equeue_cancel_user_allocated function is irq safe.
217217
//
218218
// If called while the event queue's dispatch loop is active,
219219
// equeue_cancel_user_allocated does not guarantee that the event
220-
// will not not execute after it returns as the event may have
220+
// will not execute after it returns as the event may have
221221
// already begun executing.
222222
bool equeue_cancel_user_allocated(equeue_t *queue, void *event);
223223

0 commit comments

Comments
 (0)