diff options
| author | Yabin Cui <yabinc@google.com> | 2015-08-26 11:18:42 -0700 |
|---|---|---|
| committer | Yabin Cui <yabinc@google.com> | 2015-08-26 11:27:43 -0700 |
| commit | 34f45c566365c966c78264e8a4dc0cf69957b6fa (patch) | |
| tree | d6f5d191d4979d4df9183aed95376afb26d8c876 /base/errors_unix.cpp | |
| parent | 0ac29519ac75a72a4ecacffc819eff9adf5b1b70 (diff) | |
adb: keep all asocket operations in the main thread.
As far as I can see, all asockets operations happen in fdevent_loop()
in the main thread, excepting close_all_sockets(). Instead of adding
lock and ref_count for each asocket, a simpler way would be moving
close_all_sockets() from input_thread to the main thread.
In input_thread(), there are two path to break the loop and call
close_all_sockets(). One path is when receiving offline A_SYNC, which
is sent by the main thread. The other path is when read_packet
fails, which I believe is almost not possible and doesn't matter
(Because t->fd is closed just before t is freed.). So I move
close_all_sockets() to handle_offline() in the main thread.
the socket_list_lock in sockets.cpp could be removed. But I prefer
to leave it for the following changes.
Bug: 6558362
Change-Id: I5da23f60a67a331262c62693b9b127fe2689c799
Diffstat (limited to 'base/errors_unix.cpp')
0 files changed, 0 insertions, 0 deletions
