Merge "adb: fix darwin build break."
This commit is contained in:
commit
a0661237e1
3 changed files with 6 additions and 3 deletions
|
|
@ -30,6 +30,8 @@ void usb_init() {
|
||||||
void usb_cleanup() {
|
void usb_cleanup() {
|
||||||
if (should_use_libusb()) {
|
if (should_use_libusb()) {
|
||||||
libusb::usb_cleanup();
|
libusb::usb_cleanup();
|
||||||
|
} else {
|
||||||
|
native::usb_cleanup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -598,4 +598,7 @@ void usb_init() {
|
||||||
|
|
||||||
std::thread(device_poll_thread).detach();
|
std::thread(device_poll_thread).detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void usb_cleanup() {}
|
||||||
|
|
||||||
} // namespace native
|
} // namespace native
|
||||||
|
|
|
||||||
|
|
@ -430,7 +430,7 @@ static void RunLoopThread() {
|
||||||
VLOG(USB) << "RunLoopThread done";
|
VLOG(USB) << "RunLoopThread done";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usb_cleanup() NO_THREAD_SAFETY_ANALYSIS {
|
void usb_cleanup() NO_THREAD_SAFETY_ANALYSIS {
|
||||||
VLOG(USB) << "usb_cleanup";
|
VLOG(USB) << "usb_cleanup";
|
||||||
// Wait until usb operations in RunLoopThread finish, and prevent further operations.
|
// Wait until usb operations in RunLoopThread finish, and prevent further operations.
|
||||||
operate_device_lock.lock();
|
operate_device_lock.lock();
|
||||||
|
|
@ -440,8 +440,6 @@ static void usb_cleanup() NO_THREAD_SAFETY_ANALYSIS {
|
||||||
void usb_init() {
|
void usb_init() {
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
atexit(usb_cleanup);
|
|
||||||
|
|
||||||
usb_inited_flag = false;
|
usb_inited_flag = false;
|
||||||
|
|
||||||
std::thread(RunLoopThread).detach();
|
std::thread(RunLoopThread).detach();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue