exynos9610: USB: Fix potential racing by wall time change
authorWei Wang <wvw@google.com>
Fri, 11 Aug 2017 22:05:46 +0000 (15:05 -0700)
committerJan Altensen <info@stricted.net>
Sun, 1 Nov 2020 02:06:29 +0000 (03:06 +0100)
commitac7e26e5f70f11239738a286c3d33ef2181af408
tree8bef32700e2bddb20763b52d990e447ff651d0e4
parentee70a3ea715e17c777f3e66593233dfea87029db
exynos9610: USB: Fix potential racing by wall time change
 in USBhal

pthread_cond_timedwait used wall time so it might introduce racing,
pthread_cond_timedwait_monotonic_np is Android specific but it is being
deprecated. And now Android support pthread_condattr_setclock so use it
to wait on CLOCK_MONOTONIC instead.

Bug: 64623895
Test: USB switch function works, charging/MTP/PTP
Change-Id: I136533ff90ef1be2b042ef1e0829643f2f7aa968
hidl/usb/Usb.cpp
hidl/usb/Usb.h