Boost.ASIO: upgrade io_service=>io_context, finally

This commit is contained in:
2026-05-30 11:59:42 -04:00
parent f100764bd8
commit 4266af545a
26 changed files with 91 additions and 90 deletions
@@ -224,9 +224,9 @@ void OpenClCollatingAndMeshingEngine::finalize()
*/
int delayMs = std::max(OCLCOLLMESH_ENGN_FINALIZE_DELAY_MS, 0);
auto& ioService = smoHooksPtr->ComponentThread_getSelf()->getIoService();
sscl::cps::AsynchronousBridge bridge(ioService);
boost::asio::deadline_timer timeoutTimer(ioService);
auto& ioContext = smoHooksPtr->ComponentThread_getSelf()->getIoContext();
sscl::cps::AsynchronousBridge bridge(ioContext);
boost::asio::deadline_timer timeoutTimer(ioContext);
/** EXPLANATION:
* We wait for delayMs milliseconds to ensure that any in-flight OpenCL
@@ -248,7 +248,7 @@ void OpenClCollatingAndMeshingEngine::finalize()
bridge.setAsyncOperationComplete();
});
bridge.waitForAsyncOperationCompleteOrIoServiceStopped();
bridge.waitForAsyncOperationCompleteOrIoContextStopped();
}
// Release OpenCL buffers via smo hooks
@@ -317,10 +317,10 @@ void CL_CALLBACK OpenClCollatingAndMeshingEngine::compactKernelEventCallback(
if (!engine || !engine->compactKernelCb)
{ return; }
// Post to io_service to call callback on the correct thread
// Post to io_context to call callback on the correct thread
if (engine->parent.device && engine->parent.device->componentThread)
{
engine->parent.device->componentThread->getIoService().post(
boost::asio::post(engine->parent.device->componentThread->getIoContext(),
std::bind(engine->compactKernelCb, event_command_exec_status));
}
}
@@ -335,10 +335,10 @@ void CL_CALLBACK OpenClCollatingAndMeshingEngine::collateKernelEventCallback(
if (!engine || !engine->collateKernelCb)
{ return; }
// Post to io_service to call callback on the correct thread
// Post to io_context to call callback on the correct thread
if (engine->parent.device && engine->parent.device->componentThread)
{
engine->parent.device->componentThread->getIoService().post(
boost::asio::post(engine->parent.device->componentThread->getIoContext(),
std::bind(engine->collateKernelCb, event_command_exec_status));
}
}
@@ -1270,7 +1270,7 @@ void OpenClCollatingAndMeshingEngine::compactCollateAndMeshFrameReq(
// Start with compaction if needed, then chain to collation
if (needsCompaction)
{
parent.device->componentThread->getIoService().post(
boost::asio::post(parent.device->componentThread->getIoContext(),
STC(std::bind(
&CompactCollateAndMeshFrameReq
::compactCollateAndMeshFrameReq1_doCompact_posted,
@@ -1279,7 +1279,7 @@ void OpenClCollatingAndMeshingEngine::compactCollateAndMeshFrameReq(
else
{
// Skip compaction, go straight to collation
parent.device->componentThread->getIoService().post(
boost::asio::post(parent.device->componentThread->getIoContext(),
STC(std::bind(
&CompactCollateAndMeshFrameReq
::compactCollateAndMeshFrameReq3_doCollate_posted,