mirror of
https://gitlab.com/prpl-foundation/prplmesh/prplMesh.git
synced 2026-01-15 13:05:09 +00:00
AmbiorixConnection::read_signal and the lambda in AmbiorixImpl::init_signal_loop may race when multiple signals with the same path arrive at the same time, because the underlying amxp_signal_read does not treat the expression evaluation procedure as a critical area, which free/alloc memory to the expression binary tree when evaluate fields. this fix adds a mutex to avoid amxp_signal_read race condition, the cost is performance. before this commit, most signals which have different paths can race without any consequence, only those have the same path possiblly trigger SIGSEGV. after this commit, all signals handling have to be synchronized, even if they do not share the same path. Signed-off-by: Lu Dai <lu.dai@mind.be>