-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
controller shouldn't start the Platform Manager event loop #6544
Comments
Along these same lines, the Controller shouldn't be calling Shutdown or destructors for SystemLayer and InetLayer. These are either passed into the controller, or are Device Layer singletons. In either case, the Controller does not own them. This is similar to the complaint in #6544. |
This seems somewhat related to #7429 #7430. General observations about
|
Solved with the controller factory. |
Problem
The existence of this interface creates no value:
Externally, there's no indication here that calling into this DeviceController instance will actually start a thread in the Platform Manager singleton. Furthermore, calling twice leads to undefined behavior in at least the Posix platform, due to a double-call to pthread_create.
It's just as simple to call
DeviceLayer::PlatformMgr().StartEventLoopTask()
directly, and with such a call, it is very obvious that an event loop is being started in the Platform Manager singleton.Proposed Solution
CHIP_ERROR DeviceController::ServiceEvents()
DeviceLayer::PlatformMgr().StartEventLoopTask()
The text was updated successfully, but these errors were encountered: