-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: forward declare msg_t in thread.h #16477
Conversation
@@ -163,6 +162,11 @@ extern "C" { | |||
*/ | |||
typedef void *(*thread_task_func_t)(void *arg); | |||
|
|||
/** | |||
* @brief Forward declaration of msg_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if you use @ref struct msg
here, doxygen will correctly render it. All in all, it would be nice to have a link to the actual struct, since this is in a completely different header.
@@ -168,7 +168,7 @@ | |||
#include <stdint.h> | |||
#include <stdbool.h> | |||
|
|||
#include "sched.h" | |||
#include "thread.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "thread.h" | |
#include "thread.h" /* include forward declaration of `msg_t`. */ |
?
With this, The problem with the cross header forward declaration is that they mask the underlying problem of circular dependencies, rather than solving it. |
Maybe, but I don't think that's the issue here. thread and sched are not really distinct modules. This shows in e.g., |
Shouldn't it rather be the other way around? A kernel can't have threads without a scheduler, but the other way around it works ;-). |
well, maybe. most parts of the system and most apps will use the thread API, though. not much from sched other than defines. |
Then I think there should be a |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Contribution description
Alternative to #16458.
This forward-declares msg_t in thread.h, and adapts thread.h, sched.h and msg.h accordingly.
Testing procedure
Issues/PRs references