Skip to content

v1.3.3

Choose a tag to compare

@github-actions github-actions released this 20 Jun 21:02
· 9 commits to master since this release
fix: join the connect-notify thread instead of detaching it

After a successful connect the bus thread spawned a detached thread to run
notifyDevicesConnected() (onBusConnected() blocks on future.get(), so it cannot
run on the bus thread). That thread locks mtx_ and schedules retries, but the
destructor never waited for it: on a shutdown shortly after a connect it could
lock mtx_ after ~FroniusBus had destroyed it, aborting with
std::system_error "Invalid argument" from pthread_mutex_lock on a freed mutex.

Track it as notifyConnectThread_ (a reconnect joins the previous one first)
and join it in the destructor, after the bus thread and before retries_ is
moved out. running_ is already false by then, so any scheduleDeviceRetry() it
runs returns without queuing work and the join is immediate; retries it did
schedule are still captured by the existing retries_ join.