Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 436f0e6d authored by Yifan Hong's avatar Yifan Hong
Browse files

~RpcServer() calls shutdown explicitly.

If a thread is calling RpcServer::join() and poll()-ing,
when ~RpcServer() is called, the first thing it does
is deleting mJoinShutdownTrigger, which will close the
read end first.

poll(2):
  For a discussion of what may happen if a file descriptor being
  monitored by poll() is closed in another thread, see select(2).

select(2):
  If a file descriptor being monitored by select() is closed in
  another thread, the result is unspecified.

To avoid relying on UB, properly shut down before closing these fds.

Test: binderRpcTest
Test: binderLibTest

Bug: 182914638

Change-Id: Id689fa31e6cbf055f6c60a443e8f4ad0dae7ceb1
parent fc907867
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment