Todo: update and add comments to finalizeInd

This commit is contained in:
2025-10-30 21:54:21 -04:00
parent b3d0565e11
commit 393326052c
2 changed files with 17 additions and 0 deletions
+13
View File
@@ -76,6 +76,19 @@ public:
+ ": Must be executed on Marionette thread"); + ": Must be executed on Marionette thread");
} }
/** FIXME:
* It may be necessary to add a delay here to ensure that all in-flight
* timer timeouts have finished executing? Or some other mechanism.
*
* We need some way to ensure that in-flight timeouts don't get fired
* during the finalize sequence. This is because they may depend on
* state that is being finalized or has been finalized at the point
* when they timeout.
*
* This seems to be actually happening with the delayed calls to
* AttachDeviceReq::attachDeviceReq2() inside of livoxGen1.cpp.
*/
device::DeviceManager::getInstance().finalizeDeviceReattacher(); device::DeviceManager::getInstance().finalizeDeviceReattacher();
smo::mind::globalMind->finalizeReq({context, std::bind( smo::mind::globalMind->finalizeReq({context, std::bind(
+4
View File
@@ -25,3 +25,7 @@
after they expire just in case boost doesn't clean up the internal after they expire just in case boost doesn't clean up the internal
callable that we passed it. Or else we'll have circular sh_ptr callable that we passed it. Or else we'll have circular sh_ptr
references in our continuations. references in our continuations.
* Think of a unified mechanism or a design pattern which will ensure that
timeouts will always either expire or be canceled before program
finalization.
Or more generically, before their lifetime ends.