adb: make adb_thread_func_t return void, add adb_thread_exit.
Windows restricts the return value of threads to 32-bits, even on 64-bit
platforms. Since we don't actually return meaningful values from thread,
resolve this inconsistency with POSIX by making adb's thread abstraction
only take void functions.
Change-Id: I5c23b4432314f13bf16d606fd5e6b6b7b6ef98b5
diff --git a/transport.cpp b/transport.cpp
index 6020ad5..d9180bc 100644
--- a/transport.cpp
+++ b/transport.cpp
@@ -190,8 +190,7 @@
//
// read_transport thread reads data from a transport (representing a usb/tcp connection),
// and makes the main thread call handle_packet().
-static void *read_transport_thread(void *_t)
-{
+static void read_transport_thread(void* _t) {
atransport *t = reinterpret_cast<atransport*>(_t);
apacket *p;
@@ -244,13 +243,11 @@
D("%s: read_transport thread is exiting", t->serial);
kick_transport(t);
transport_unref(t);
- return 0;
}
// write_transport thread gets packets sent by the main thread (through send_packet()),
// and writes to a transport (representing a usb/tcp connection).
-static void *write_transport_thread(void *_t)
-{
+static void write_transport_thread(void* _t) {
atransport *t = reinterpret_cast<atransport*>(_t);
apacket *p;
int active = 0;
@@ -295,7 +292,6 @@
D("%s: write_transport thread is exiting, fd %d", t->serial, t->fd);
kick_transport(t);
transport_unref(t);
- return 0;
}
static void kick_transport_locked(atransport* t) {