Skip to content

Commit 85089e0

Browse files
committed
update(docs): add a couple of statements about m_ctx_deregister api.
Signed-off-by: Federico Di Pierro <[email protected]>
1 parent 5713b2d commit 85089e0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#### DOC
2424

2525
- [x] Fully rewrite documentation per-namespace
26-
- [ ] Document that m_ctx_deregister() cannot be called on a looping context (`M_PARAM_ASSERT(c && *c && (*c)->state == M_CTX_IDLE);`)
26+
- [x] Document that m_ctx_deregister() cannot be called on a looping context (`M_PARAM_ASSERT(c && *c && (*c)->state == M_CTX_IDLE);`)
2727
- [ ] document m_evt_t memref'd behaviour!!!
2828
- [ ] Document stats and thresh activity_freq (num_action_per_ms)
2929

docs/core/ctx.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ int m_ctx_register(const char *ctx_name, m_ctx_t **c, m_ctx_flags flags, const v
5252
int m_ctx_deregister(m_ctx_t **c);
5353
```
5454
> Deregister a ctx.
55+
> NOTE: this API cannot be called if the ctx is still looping.
56+
> Make sure to `m_ctx_quit` the loop before deregistering a context.
57+
> NOTE: unless a ctx is registered with `M_CTX_PERSIST` flag, it will get
58+
> automatically destroyed when there are no more modules registered in it.
5559
5660
**Params:**
5761

0 commit comments

Comments
 (0)