Skip to content
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

[thread] add Thread stack lock held for output the unicast addresses #33661

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ void GenericThreadStackManagerImpl_OpenThread<ImplClass>::_OnPlatformEvent(const
}

#if CHIP_DETAIL_LOGGING
Impl()->LockThreadStack();
LogOpenThreadStateChange(mOTInst, event->ThreadStateChange.OpenThread.Flags);
Impl()->UnlockThreadStack();
#endif // CHIP_DETAIL_LOGGING
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/platform/OpenThread/OpenThreadUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ void RegisterOpenThreadErrorFormatter(void)
RegisterErrorFormatter(&sOpenThreadErrorFormatter);
}

/**
* Log information related to a state change in the OpenThread stack.
*
* NB: This function *must* be called with the Thread stack lock held.
*/
void LogOpenThreadStateChange(otInstance * otInst, uint32_t flags)
{
#if CHIP_DETAIL_LOGGING
Expand Down
6 changes: 6 additions & 0 deletions src/platform/OpenThread/OpenThreadUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ namespace Internal {

extern CHIP_ERROR MapOpenThreadError(otError otErr);
extern void RegisterOpenThreadErrorFormatter(void);

/**
* Log information related to a state change in the OpenThread stack.
*
* NB: This function *must* be called with the Thread stack lock held.
*/
extern void LogOpenThreadStateChange(otInstance * otInst, uint32_t flags);
extern void LogOpenThreadPacket(const char * titleStr, otMessage * pkt);
extern bool IsOpenThreadMeshLocalAddress(otInstance * otInst, const Inet::IPAddress & addr);
Expand Down
Loading