Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 812f0304 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Clean up the locking in usb_linux.cpp.

tsan complained that usb_bulk_write accesses usb_handle members outside
a lock. Fix that, but by moving everything over to C++11 locking.

Note that the old code was checking whether pthread_cond_timedwait returned
a negative value, which it will never do --- it will signal timeout (or
any other error) by returning a positive errno value. The rewrite does
what they appeared to intend to do (break out on timeout), rather than
what they actually did (keep trying forever).

Bug: http://b/22598587
Change-Id: Iab6869ffed4874143a7da97193d6b09e34cf2933
parent 89cc750e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ LIBADB_TEST_SRCS := \
LIBADB_CFLAGS := \
    $(ADB_COMMON_CFLAGS) \
    -fvisibility=hidden \
    -std=c++14 \

LIBADB_darwin_SRC_FILES := \
    fdevent.cpp \
+179 −245

File changed.

Preview size limit exceeded, changes collapsed.