trunks: mask signals handled by the service in all threads

The service object started by trunksd installs its own signal
handlers to perform graceful shutdown. Before this change, the
background thread was started with an empty signal mask, which
resulted in the process killed before it could finish the graceful
shutdown on the service thread.

This change masks the signal handled by the service before
starting the background thread. The thread then inherits the
signal mask.

BUG=chromium:687018
TEST=with a running trunksd, run "kill `pidof trunksd`", check
     that shutdown messages are present in the log.

Change-Id: Ib617c04ccdf99a38f055f1014b045599475bfb94
Reviewed-on: https://chromium-review.googlesource.com/435548
Commit-Ready: Andrey Pronin <apronin@chromium.org>
Tested-by: Andrey Pronin <apronin@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
1 file changed