summaryrefslogtreecommitdiff
path: root/base/errors_unix.cpp
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2018-03-19 15:19:45 -0700
committerJosh Gao <jmgao@google.com>2018-03-28 23:36:24 -0700
commit3b0146cc3750c51720774ff9aa7a9e398fe79faa (patch)
tree58fbff599a64bf32e7e1d8d0087f647dbf86f5d0 /base/errors_unix.cpp
parent9edb94fb6b1972554393d037d3a72fa8619adc27 (diff)
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 1222abc75b7854979e6a9f982004985179bcbede)
Diffstat (limited to 'base/errors_unix.cpp')
0 files changed, 0 insertions, 0 deletions