am f03aa667: am fbdd5ee2: Merge "adb: keep all asocket operations in the main thread."
* commit 'f03aa6670e39ef1a46211960d134b2528a3649f5':
adb: keep all asocket operations in the main thread.
diff --git a/adb/adb.cpp b/adb/adb.cpp
index 29c9481..a0501a6 100644
--- a/adb/adb.cpp
+++ b/adb/adb.cpp
@@ -243,6 +243,11 @@
D("adb: offline\n");
//Close the associated usb
t->online = 0;
+
+ // This is necessary to avoid a race condition that occured when a transport closes
+ // while a client socket is still active.
+ close_all_sockets(t);
+
run_transport_disconnects(t);
}
diff --git a/adb/transport.cpp b/adb/transport.cpp
index afdab86..5e4ffbb 100644
--- a/adb/transport.cpp
+++ b/adb/transport.cpp
@@ -330,10 +330,6 @@
put_apacket(p);
}
- // this is necessary to avoid a race condition that occured when a transport closes
- // while a client socket is still active.
- close_all_sockets(t);
-
D("%s: transport input thread is exiting, fd %d\n", t->serial, t->fd);
kick_transport(t);
transport_unref(t);