From ef9eef2bc3273c5b24fccc5f9b916d90cb3e091c Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Tue, 4 Nov 2025 00:56:46 -0400 Subject: [PATCH] PCloudStimBuff: Add useful dbg msg for thread affinity rigour --- stimBuffApis/livoxGen1/pcloudStimulusBuffer.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/stimBuffApis/livoxGen1/pcloudStimulusBuffer.cpp b/stimBuffApis/livoxGen1/pcloudStimulusBuffer.cpp index 2c50c79..4757916 100644 --- a/stimBuffApis/livoxGen1/pcloudStimulusBuffer.cpp +++ b/stimBuffApis/livoxGen1/pcloudStimulusBuffer.cpp @@ -32,6 +32,22 @@ formatDesc(formatDesc), stagingBuffer( OpenClConstraints(), nDgramsPerStagingBufferFrame), ioUringAssemblyEngine(*this) { + std::cout << __func__ << ": Device's component thread is " + << device->componentThread->name << std::endl; + +#ifndef CONFIG_WORLD_USE_BODY_THREAD + if (smoHooksPtr->ComponentThread_getSelf()->id != ComponentThread::WORLD) +#else + if (smoHooksPtr->ComponentThread_getSelf()->id != ComponentThread::BODY) +#endif + { + std::string errMsg = std::string(__func__) + + ": PcloudStimulusBuffer constructor called on non-world/body thread " + + smoHooksPtr->ComponentThread_getSelf()->name; + + std::cout << errMsg << std::endl; + // throw std::runtime_error(errMsg); + } } void PcloudStimulusBuffer::start()