rmw_wait maybe blocking the single exeuctor thread?

asked 2021-06-22 07:01:53 -0500

In rmw_wait function, there is comments here //This mutex prevents any of the listeners to change the internal state and notify the condition between the call to hasData() / hasTriggered() and wait() otherwise the decision to wait might be incorrect

we can see rmw_wait funciton hold conditionMutex here, and if no hasData , it will call conditionVariable->wait(lock, predicate) in rmw_wait function. However, any listener cannot get the conditionMutex(because it hold by rmw_wait funtion itself), so it cannot change hasData/hasEvent/hasTrigger return data. So predicate will be always false, rmw_wait will be always blocking here and cannot be notified to wake up ?

Anyone Can help to explain this issue ? is it potential problem´╝č

edit retag flag offensive close merge delete