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

Skip to content
Commit 3b0146cc authored by Josh Gao's avatar Josh Gao
Browse files

adb: make fdevent_run_on_main_thread's fd nonblocking.

If we get a ton of fdevent_run_on_main_thread calls while running one
of the handlers, the socket might become full, which will result in a
deadlock in fdevent_run_on_main_thread when a write to the fd blocks
with the mutex taken. Resolve this by making the fd nonblocking, which
is safe because we always write after appending to the list, and read
before emptying the list, which guarantees that if the byte we write is
consumed, the std::function we appended will be run.

Bug: http://b/74616284
Test: adb_test
Test: python test_device.py
Change-Id: I29319bda2ad7b5a5cdcd91d1d0ddf39f7ab7d115
(cherry picked from commit 1222abc7)
parent 9edb94fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment