OSDN Git Service

libpdx_uds: Serialize access to connection socket between threads
authorAlex Vakulenko <avakulenko@google.com>
Tue, 18 Apr 2017 21:41:33 +0000 (14:41 -0700)
committerAlex Vakulenko <avakulenko@google.com>
Wed, 19 Apr 2017 19:30:12 +0000 (12:30 -0700)
commitfd22b3e5ad1aae1fc3de54801f33466db3c9b3fe
tree195ca2c2ee509dce7e670f67b35afe47d217f4a0
parent6eefa42d33bdddc3603211634f98937b00abc532
libpdx_uds: Serialize access to connection socket between threads

Added a mutex to allow only one client thread to perform atomic
send-request/receive-responce actions.

Also added a unit test that perfroms multiple parallel client requests
to the same service to ensure it can handle multithreaded access
correctly.

Bug: 37443070
Test: `libpdx_uds_tests` pass
Change-Id: Ica516f7806f9146fb530b5cb371d2ee89146fed7
libs/vr/libpdx_uds/Android.bp
libs/vr/libpdx_uds/client_channel.cpp
libs/vr/libpdx_uds/client_channel_tests.cpp [new file with mode: 0644]
libs/vr/libpdx_uds/private/uds/client_channel.h