trunks: Stop background thread when exiting trunksd

The background thread may access and holds references to
BackgroundCommandTransceiver, ResourceManager and other objects,
created by the main thread. Stop the background thread
before these objects are destroyed when the daemon exits.

TEST=reboot without trunksd coredump in /var/spool/crash

Change-Id: I0ed0a2a6853114066a683ae6be977dcc977b4c34
Commit-Ready: Andrey Pronin <>
Tested-by: Andrey Pronin <>
Reviewed-by: Ben Chan <>
1 file changed