Conversation
|
Not tested, but at least code-wise it looks simpler then my implementation. However: I would prefer putting the non-mbox related changes to core into a separate commit. |
|
This is based on #4557, right? |
Ah, yes... |
core/include/mbox.h
Outdated
| }; | ||
|
|
||
| void mbox_put(mbox_t *mbox, msg_t *msg); | ||
| int mbox_tryput(mbox_t *mbox, msg_t *msg); |
There was a problem hiding this comment.
For API consistency: mbox_try_put()
|
I really would like to have this soonish (though lwIP is already winning time-wise despite my crappy-mbox API :P) |
|
@authmillenon Sorry, I found a flaw in the logic. Will have to fix that first. |
|
Kk. Thesis evaluation is done anyways. Mentioned this PR as an optimization possibility, but used my mbox implementation for the actual comparison. |
|
Fixes #4342 |
|
(please rebase) |
I un-marked WIP as it should be usable now. Let's add timeout versions later. |
|
As this is very unintrusive, we could think about merging for the release, marking it as experimental? |
core/include/thread.h
Outdated
| #if defined(MODULE_CORE_MSG) || defined(MODULE_CORE_THREAD_FLAGS) | ||
| void *wait_data; /**< used by msg and thread flags */ | ||
| #if defined(MODULE_CORE_MSG) || defined(MODULE_CORE_THREAD_FLAGS) \ | ||
| || defined(MODULE_MBOX) |
There was a problem hiding this comment.
How does that module gets defined?
core/include/mbox.h
Outdated
| #endif | ||
|
|
||
| /** Static initializer for mbox objects */ | ||
| #define MBOX_INIT(queue, queue_size) {{0}, {0}, CIB_INIT(queue_size), queue, NULL} |
There was a problem hiding this comment.
Also needs a dynamic initializer e.g.:
static inline void mbox_init(mbox_t *mbox, msg_t queue, unsigned int queue_size)
{
mbox_t m = MBOX_INIT(queue, queue_size);
*mbox = m;
}so you can (re-)initialize the variable at other points than variable definition
|
|
@miri64 ACK still stands? |
core/include/mbox.h
Outdated
|
|
||
| #ifndef MODULE_CORE_MBOX | ||
| #error mbox depends on the module core_mbox! | ||
| #endif |
There was a problem hiding this comment.
IMHO this is superfluous. The linker will yield an error anyway.
Apart from comment above, yes :-) |
|
|
Looks good from what I can see. |
|
AVR and MSP430 are butthurt about something. |
|
Ping? |
|
Hm, that seems to be a compiler problem. My arch avr-gcc (5.3.0) compiles the code just fine, the one used by murdock doesn't. |
|
|
Turns out there was an excess initializer. Makes me wonder why the other compilers didn't choke on that.
|
|
two ACKs -> go |
Alternative to #4552.
differences:
WIP:
(
timeout functions missing) postponed