adb: add lock to remove_socket.

The comment that was previously here says that local_socket_list_lock
must be taken, but this function is exposed to external callers that
can't possibly take the lock.

Bug: http://b/65419665
Test: python test_device.py
Change-Id: I12d464933936b2a210a827ccf19ea201020d8d78
This commit is contained in:
Josh Gao 2017-09-13 11:17:33 -07:00
parent 55c8b34f14
commit 62c92f0c05
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ void install_local_socket(asocket* s) {
}
void remove_socket(asocket* s) {
// socket_list_lock should already be held
std::lock_guard<std::recursive_mutex> lock(local_socket_list_lock);
if (s->prev && s->next) {
s->prev->next = s->next;
s->next->prev = s->prev;